Module: Packable::Extensions::Proc
- Defined in:
- lib/packable/extensions/proc.rb
Instance Method Summary collapse
-
#bind(to) ⇒ Object
Shortcut for
unbind.bind(to). -
#unbind ⇒ Object
A bit of wizardry to return an
UnboundMethodwhich can be bound to any object.
Instance Method Details
#bind(to) ⇒ Object
Shortcut for unbind.bind(to)
11 12 13 |
# File 'lib/packable/extensions/proc.rb', line 11 def bind(to) unbind.bind(to) end |
#unbind ⇒ Object
A bit of wizardry to return an UnboundMethod which can be bound to any object
5 6 7 8 |
# File 'lib/packable/extensions/proc.rb', line 5 def unbind Object.send(:define_method, :__temp_bound_method, &self) Object.instance_method(:__temp_bound_method) end |