Class: Proc

Inherits:
Object show all
Defined in:
lib/simple_mapper/support/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#in_context(klass_or_obj) ⇒ Object

Changes the context of a proc so that ‘self’ is the klass_or_obj passed.



13
14
15
# File 'lib/simple_mapper/support/core_ext.rb', line 13

def in_context(klass_or_obj)
  klass_or_obj.send(:eval, self.to_ruby)
end