Module: Bindless::EXT::Proc
- Defined in:
- lib/bindless/proc.rb
Instance Method Summary collapse
Instance Method Details
#call_with_binding(bind, *args) ⇒ Object
6 7 8 |
# File 'lib/bindless/proc.rb', line 6 def call_with_binding(bind, *args) ::Bindless::Model.new([bind]).run_proc(self, *args) end |
#call_with_obj(obj, *args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bindless/proc.rb', line 10 def call_with_obj(obj, *args) m = nil p = self ::Object.class_eval do define_method :a_temp_method_name, &p m = instance_method :a_temp_method_name remove_method :a_temp_method_name end m.bind(obj).call(*args) end |