Class: CapsuleCRM::Child

Inherits:
Base
  • Object
show all
Defined in:
lib/capsulecrm/child.rb

Direct Known Subclasses

Contact, CustomField, HistoryItem, Tag, Website

Instance Attribute Summary collapse

Attributes inherited from Base

#id, #raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #errors, find, last_response, #new_record?

Constructor Details

#initialize(parent, attributes = {}) ⇒ Child

nodoc



6
7
8
9
# File 'lib/capsulecrm/child.rb', line 6

def initialize(parent, attributes={})
  @parent = parent
  super(attributes)
end

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



2
3
4
# File 'lib/capsulecrm/child.rb', line 2

def parent
  @parent
end

Class Method Details

.init_many(parent, data) ⇒ Object

nodoc



13
14
15
# File 'lib/capsulecrm/child.rb', line 13

def self.init_many(parent, data)
  CapsuleCRM::ChildCollection.new(parent, self, data)
end

.init_one(parent, data) ⇒ Object

nodoc



19
20
21
# File 'lib/capsulecrm/child.rb', line 19

def self.init_one(parent, data)
  new(parent, attributes_from_xml_map(data))
end