Module: Hypo::Scope

Defined in:
lib/hypo/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#instancesObject (readonly)

Returns the value of attribute instances.



3
4
5
# File 'lib/hypo/scope.rb', line 3

def instances
  @instances
end

Instance Method Details

#purgeObject



9
10
11
12
13
14
15
16
17
# File 'lib/hypo/scope.rb', line 9

def purge
  begin
    @instances.each_value do |instance|
      instance.finalize if instance.respond_to? :finalize
    end
  ensure
    @instances = Hash.new
  end
end

#releaseObject



5
6
7
# File 'lib/hypo/scope.rb', line 5

def release
  @container.lifetimes[:scope].purge(self)
end