Closed ghost closed 14 years ago
Sorry I made a mistake in the topic name - it should be Effigy::View#render .. oops, very tried :-)
Thanks for the patch. However, if the block passed to #render is evaluated in the context of the view instance, it means there's no way to reference methods on the calling object from within the block. The way things are implemented now, you can access all public view methods by calling them on the view object. Anything that requires use of private methods can be handled using a subclass. In almost every case, a subclass is favorable anyway.
Yeah, of course, I didn't even think of that! :-)
A closure is evaluated in the context it was defined in when passed onto Effigy::View#render which means Effigy::View isn't in context and you can't instance methods found on that class.
I made a patch: http://github.com/robgleeson/effigy/commit/86522c281f21b969f4a5726f4385009e2947fc22 and reported it to the network effigy is in but no replies.