Class: Utilrb::WeakRef

Inherits:
WeakRef
  • Object
show all
Defined in:
lib/utilrb/weakref.rb

Instance Method Summary collapse

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

#getObject



12
13
14
# File 'lib/utilrb/weakref.rb', line 12

def get
    __getobj__
end