class DeepStore::Sweeper

Attributes

stream[R]

Public Class Methods

new(stream) click to toggle source
# File lib/deep_store/sweeper.rb, line 11
def initialize(stream)
  @stream = stream
end
register(object, stream) click to toggle source
# File lib/deep_store/sweeper.rb, line 5
def self.register(object, stream)
  sweeper = Sweeper.new(stream)
  ObjectSpace.define_finalizer(object, sweeper)
  sweeper
end

Public Instance Methods

call(_object_id) click to toggle source
# File lib/deep_store/sweeper.rb, line 15
def call(_object_id)
  finalize
end
finalize() click to toggle source
# File lib/deep_store/sweeper.rb, line 19
def finalize
  stream.close if stream.respond_to?(:close)
  stream.unlink if stream.respond_to?(:unlink)
end