Class: Apia::ObjectSet

Inherits:
Set
  • Object
show all
Defined in:
lib/apia/object_set.rb

Instance Method Summary collapse

Instance Method Details

#add_object(object) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/apia/object_set.rb', line 8

def add_object(object)
  return self if include?(object)

  self << object
  if object.respond_to?(:collate_objects)
    # Attempt to add any other objects if the object responds to
    # collate_objects.
    object.collate_objects(self)
  end
  self
end