Class: CapsuleCRM::Collection
- Inherits:
-
Array
- Object
- Array
- CapsuleCRM::Collection
- Defined in:
- lib/capsulecrm/collection.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(klass, data) ⇒ Collection
constructor
nodoc.
Constructor Details
#initialize(klass, data) ⇒ Collection
nodoc
5 6 7 8 9 10 11 |
# File 'lib/capsulecrm/collection.rb', line 5 def initialize(klass, data) return if data.nil? [data].flatten.each do |attributes| attributes = klass.attributes_from_xml_hash(attributes) self.push klass.new(attributes) end end |