Sha256: baa7a891029a5f32acba105e84e11b60af2e9d08a020185e6d9a6735b02195a1

Contents?: true

Size: 356 Bytes

Versions: 5

Compression:

Stored size: 356 Bytes

Contents

class Wref::Implementations::Ref
  def initialize(object)
    require "ref"
    @ref = ::Ref::WeakReference.new(object)
  end

  def get
    @ref.object
  end

  def get!
    object = @ref.object
    raise Wref::Recycled unless object
    return object
  end

  def alive?
    if @ref.object
      return true
    else
      return false
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wref-0.0.11 lib/wref/implementations/ref.rb
wref-0.0.10 lib/wref/implementations/ref.rb
wref-0.0.9 lib/wref/implementations/ref.rb
wref-0.0.8 lib/wref/implementations/ref.rb
wref-0.0.7 lib/wref/implementations/ref.rb