hacks/holder |
Public Methods |
Create a Holder class, to allow non-reference objects to be returned. In Scheme, this might be known as a "Box".
Example:
FixnumHolder = Holder(Fixnum)
def foo(inout)
inout.value = 42
end
a = FixnumHolder.new(10)
puts a #=> 10
foo(a)
puts a #=> 42
puts a + 5 #=> 47
| klass | the class to generate a holder class for. |
|---|
Returns: a new class that can be used as a holder.
class Holder < Object |
Public Methods |