Class: AgnosticBackend::Indexable::ObjectObserver

Inherits:
Object
  • Object
show all
Defined in:
lib/agnostic_backend/indexable/object_observer.rb

Instance Method Summary collapse

Constructor Details

#initializeObjectObserver

Returns a new instance of ObjectObserver.



7
8
9
# File 'lib/agnostic_backend/indexable/object_observer.rb', line 7

def initialize
  @objects = Set.new
end

Instance Method Details

#add(obj) ⇒ Object



11
12
13
14
# File 'lib/agnostic_backend/indexable/object_observer.rb', line 11

def add(obj)
  raise CircularReferenceError.new(obj) if @objects.include? obj
  @objects << obj
end