Class: Utilrb::WeakRef
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(obj) ⇒ WeakRef
constructor
A new instance of WeakRef.
Constructor Details
#initialize(obj) ⇒ WeakRef
Returns a new instance of WeakRef.
5 6 7 8 9 10 |
# File 'lib/utilrb/weakref.rb', line 5 def initialize(obj) if obj.kind_of?(::WeakRef) Kernel.raise ::ArgumentError, "cannot create a weakref of a weakref" end super end |
Instance Method Details
#get ⇒ Object
12 13 14 |
# File 'lib/utilrb/weakref.rb', line 12 def get __getobj__ end |