class Ref::StrongReference
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
Source
# File lib/ref/strong_reference.rb, line 7 def initialize(obj) @obj = obj @referenced_object_id = obj.__id__ end
Create a new strong reference to an object.
Public Instance Methods
Source
# File lib/ref/strong_reference.rb, line 13 def object @obj end
Get the referenced object.