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
- .find_transform(attrs) ⇒ Object
- .save_transform(attrs) ⇒ Object
- .transform(attrs) ⇒ Object
- .where_transform(attrs) ⇒ Object
Instance Method Summary collapse
Methods included from Model
#defined_attributes, #destroy, included, #initialize, #persisted?, #save, #to_h
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
.find_transform(attrs) ⇒ Object
21 22 23 24 |
# File 'lib/connectwise/company.rb', line 21 def self.find_transform(attrs) attrs[:id] ||= attrs.delete(:company_rec_id) attrs end |
.save_transform(attrs) ⇒ Object
26 27 28 29 |
# File 'lib/connectwise/company.rb', line 26 def self.save_transform(attrs) attrs[:id] ||= attrs.delete(:company_rec_id) attrs end |
.transform(attrs) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/connectwise/company.rb', line 14 def self.transform(attrs) attrs[:company_name] ||= attrs.delete(:name) attrs[:status] ||= 'Active' attrs[:company_id] ||= SecureRandom.hex(12) attrs end |
.where_transform(attrs) ⇒ Object
9 10 11 12 |
# File 'lib/connectwise/company.rb', line 9 def self.where_transform(attrs) attrs[:company_name] ||= attrs.delete(:name) if attrs[:name] attrs end |
Instance Method Details
#to_cw_h ⇒ Object
31 32 33 34 35 |
# File 'lib/connectwise/company.rb', line 31 def to_cw_h attrs = super attrs['CompanyID'] = attrs.delete('CompanyId') attrs end |