Class: CapsuleCRM::Organisation
- Defined in:
- lib/capsulecrm/organisation.rb
Instance Attribute Summary collapse
-
#about ⇒ Object
Returns the value of attribute about.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Base
Class Method Summary collapse
-
.init_many(response) ⇒ Object
nodoc.
-
.init_one(response) ⇒ Object
nodoc.
-
.xml_map ⇒ Object
nodoc.
Instance Method Summary collapse
-
#people ⇒ Object
nodoc.
Methods inherited from Party
#addresses, #custom_fields, #emails, find_all_by_email, find_by_email, get_path, #is?, #phone_numbers, search, #tag, #tag_names, #tags, #untag, #websites
Methods included from History
#add_history, #history, #history!
Methods inherited from Base
#==, #errors, find, #initialize, last_response, #new_record?
Constructor Details
This class inherits a constructor from CapsuleCRM::Base
Instance Attribute Details
#about ⇒ Object
Returns the value of attribute about.
3 4 5 |
# File 'lib/capsulecrm/organisation.rb', line 3 def about @about end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/capsulecrm/organisation.rb', line 4 def name @name end |
Class Method Details
.init_many(response) ⇒ Object
nodoc
18 19 20 21 |
# File 'lib/capsulecrm/organisation.rb', line 18 def self.init_many(response) data = response['parties']['organisation'] CapsuleCRM::Collection.new(self, data) end |
.init_one(response) ⇒ Object
nodoc
25 26 27 28 |
# File 'lib/capsulecrm/organisation.rb', line 25 def self.init_one(response) data = response['organisation'] new(attributes_from_xml_hash(data)) end |
.xml_map ⇒ Object
nodoc
32 33 34 35 36 37 38 |
# File 'lib/capsulecrm/organisation.rb', line 32 def self.xml_map map = { 'about' => 'about', 'name' => 'name' } super.merge map end |
Instance Method Details
#people ⇒ Object
nodoc
8 9 10 11 12 13 14 |
# File 'lib/capsulecrm/organisation.rb', line 8 def people return @people if @people path = self.class.get_path path = [path, '/', id, '/people'].join last_response = self.class.get(path) @people = CapsuleCRM::Person.init_many(last_response) end |