Module: IndifferentEval
- Defined in:
- lib/indifferent_eval/module.rb
Instance Method Summary collapse
Instance Method Details
#indifferent_eval(object_to_eval_on = self, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/indifferent_eval/module.rb', line 3 def indifferent_eval object_to_eval_on = self, &block if block.arity == -1 # no block variable, use instance_eval object_to_eval_on.instance_eval &block else # we were passed a variable, so #call the block block.call object_to_eval_on end end |