I suspect you may have oversimplified your question or I don't understand it, because it looks trivial from here....
> If not, it is possible to add an elegant check inside the to_code > function to change the code generated? > > def to_code(n) > allowed=... some kind of elegant check ... > if (allowed) > "Generated code for "+n.to_s > else > "No code for you!!!" > end > end does `allowed=n.view_permitted?` not work? > > Now I want to allow using the to_code(n) function to those people that > are allowed to view the n argument Node. > > class CodeGen ... > > def to_code_permitted? (attributes) > # Return correspondant Node.viewable_by?() answer, using the n > node instance > # Do not know how. > end > ... > end n has to come from somewhere -- is it in the object or can you pass it in to to_code_permitted? cheers, Bryan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hobousers?hl=en -~----------~----~----~----~------~----~------~--~---
