Class: Connectwise::Company
- Inherits:
-
Object
- Object
- Connectwise::Company
- Includes:
- Model
- Defined in:
- lib/connectwise/company.rb,
lib/connectwise/connectwise.rb
Instance Attribute Summary collapse
-
#company_id ⇒ Object
Returns the value of attribute company_id.
-
#company_name ⇒ Object
Returns the value of attribute company_name.
-
#fax_number ⇒ Object
Returns the value of attribute fax_number.
-
#id ⇒ Object
Returns the value of attribute id.
-
#market ⇒ Object
Returns the value of attribute market.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#status ⇒ Object
Returns the value of attribute status.
-
#territory ⇒ Object
Returns the value of attribute territory.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#web_site ⇒ Object
Returns the value of attribute web_site.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(connection, attrs) ⇒ Company
constructor
A new instance of Company.
- #to_cw_h ⇒ Object
Methods included from Model
#defined_attributes, #destroy, included, #persisted?, #save, #to_h
Constructor Details
#initialize(connection, attrs) ⇒ Company
Returns a new instance of Company.
14 15 16 17 18 |
# File 'lib/connectwise/company.rb', line 14 def initialize(connection, attrs) super @company_id ||= SecureRandom.hex(12) @status ||= 'Active' end |
Instance Attribute Details
#company_id ⇒ Object
Returns the value of attribute company_id.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def company_id @company_id end |
#company_name ⇒ Object
Returns the value of attribute company_name.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def company_name @company_name end |
#fax_number ⇒ Object
Returns the value of attribute fax_number.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def fax_number @fax_number end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def id @id end |
#market ⇒ Object
Returns the value of attribute market.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def market @market end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def phone_number @phone_number end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def status @status end |
#territory ⇒ Object
Returns the value of attribute territory.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def territory @territory end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
90 91 92 |
# File 'lib/connectwise/connectwise.rb', line 90 def url @url end |
#web_site ⇒ Object
Returns the value of attribute web_site.
7 8 9 |
# File 'lib/connectwise/company.rb', line 7 def web_site @web_site end |
Class Method Details
.transform(attrs) ⇒ Object
9 10 11 12 |
# File 'lib/connectwise/company.rb', line 9 def self.transform(attrs) attrs[:company_name] ||= attrs.delete(:name) attrs end |
Instance Method Details
#to_cw_h ⇒ Object
20 21 22 23 24 |
# File 'lib/connectwise/company.rb', line 20 def to_cw_h attrs = super attrs['CompanyID'] = attrs.delete('CompanyId') attrs end |