This implementation of Reference holds a
strong reference to an object. The referenced object will not be garbage
collected as long as the strong reference exists.
Public Class Methods
new(obj)click to toggle source
Create a new strong reference to an object.
# File lib/ref/strong_reference.rb, line 7definitialize(obj)
@obj = obj@referenced_object_id = obj.__id__end
Public Instance Methods
object()click to toggle source
Get the referenced object.
# File lib/ref/strong_reference.rb, line 13defobject@objend