being added to my models via a plugin. my question is how might i
call these methods if the method name is passed as a symbol or string
parameter to another method?
def do_something(options = {})
if options.has_key?(:event)
# call the dynamic! method specified by options[:event]
# would it
end
end
for some reason, i thought send had to take a symbol
now, my other problem is this...
the method i am sending to accepts a block. how can i pass the block
off to send?
i currently using this way, method i am sending gets called, but the
block isn't so i figure i am missing something
def do_something(options => { :event => nil, :by => nil })
# validate options
...
send("#{options[:event}!") do
# expecting this to get passed to the method in send
audit(options[:by])
end
end
# dynamic method
def assign!
..
yield(self) if block_given?
end