Methods
Public Instance methods
to_openobject()

Translates a Proc into an OpenObject. By droping an OpenObject into the Proc, the resulting assignments incured as the procedure is evaluated produce the OpenObject. This technique is simlar to that of MethodProbe.

  p = lambda { |x|
    x.word = "Hello"
  }
  o = p.to_openobject
  o.word #=> "Hello"

NOTE The Proc must have an arity of one —no more and no less.

# File lib/facets/more/openobject.rb, line 201
    def to_openobject
      raise ArgumentError, 'bad arity for converting Proc to openobject' if arity != 1
      o = OpenObject.new
      self.call( o )
      o
    end