Class: CapsuleCRM::ChildCollection

Inherits:
Collection
  • Object
show all
Defined in:
lib/capsulecrm/child_collection.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent, klass, data) ⇒ ChildCollection

nodoc



5
6
7
8
9
10
11
# File 'lib/capsulecrm/child_collection.rb', line 5

def initialize(parent, klass, data)
  return if data.nil?
  [data].flatten.each do |attributes|
    attributes = klass.attributes_from_xml_hash(attributes)
    self.push klass.new(parent, attributes)
  end
end