Module: Extlib::LocalObjectSpace

Included in:
Hook::ClassMethods
Defined in:
lib/extlib/local_object_space.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



3
4
5
6
# File 'lib/extlib/local_object_space.rb', line 3

def self.extended(klass)
  (class << klass; self; end).send :attr_accessor, :hook_scopes
  klass.hook_scopes = []
end

Instance Method Details

#object_by_id(object_id) ⇒ Object



8
9
10
# File 'lib/extlib/local_object_space.rb', line 8

def object_by_id(object_id)
  self.hook_scopes.detect {|object| object.object_id == object_id}
end