From: "ara.t.howard" Date: 2009-03-25T02:12:48+09:00 Subject: Re: tagz-5.0.0 On Mar 24, 2009, at 10:56 AM, matt neuburg wrote: > I'd like to switch to Tagz here but its method_missing isn't coming > back > to my BindingMaker to resolve unrecognized terminology: you are trying too hard ;-) cfp:~ > cat a.rb require 'rubygems' require 'tagz' require 'erb' class BindingMaker include Tagz.globally def get_binding; binding; end def do_your_thing puts div_{ testing } end def testing "it worked" end end ERB.new("<% do_your_thing %>").result(BindingMaker.new.get_binding) #
it worked
cfp:~ > ruby a.rb
it worked
tagz can be used as a library, like you were using it, but in that case you need to be explicit about the receiver. tagz is much simpler to use in it's primary capacity - as mix-in - it is in this way that completely POLS sgml generation and context/binding sensitivity can be had. the binding hack traditional builders use is there precisely to disambiguate between contexts - tagz simply avoids the issue altogether. that's what i meant by 'lame': it's totally open, and yet in a separate context with the builder pattern. kind regards. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama