Class: AgnosticBackend::Indexable::ObjectObserver
- Inherits:
-
Object
- Object
- AgnosticBackend::Indexable::ObjectObserver
- Defined in:
- lib/agnostic_backend/indexable/object_observer.rb
Instance Method Summary collapse
- #add(obj) ⇒ Object
-
#initialize ⇒ ObjectObserver
constructor
A new instance of ObjectObserver.
Constructor Details
#initialize ⇒ ObjectObserver
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 |