Module: Trying
- Defined in:
- lib/trying.rb
Defined Under Namespace
Classes: Proxy
Instance Method Summary collapse
Instance Method Details
#trying(&block) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/trying.rb', line 36 def (&block) proxy = Proxy.new(self) bound = binding() result = nil obj = proxy.instance_eval do proxy = bound.local_variable_get(:proxy) proxy.cell = proxy.instance_eval(&block) bound.local_variable_set(:proxy, proxy) end obj.cell end |