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
new(obj)
click to toggle source
Create a new strong reference to an object.
# File lib/ref/strong_reference.rb, line 7 def initialize(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 13 def object @obj end