Class: Quickeebooks::Online::Model::Customer
- Inherits:
-
IntuitType
- Object
- IntuitType
- Quickeebooks::Online::Model::Customer
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/quickeebooks/online/model/customer.rb
Constant Summary collapse
- XML_NODE =
"Customer"
- REST_RESOURCE =
"customer"
Class Method Summary collapse
-
.resource_for_collection ⇒ Object
Class methods.
Instance Method Summary collapse
- #email_address=(email_address) ⇒ Object
- #to_xml_ns(options = {}) ⇒ Object
-
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields.
- #valid_for_update? ⇒ Boolean
Methods inherited from IntuitType
Class Method Details
.resource_for_collection ⇒ Object
Class methods
67 68 69 |
# File 'lib/quickeebooks/online/model/customer.rb', line 67 def self.resource_for_collection "#{self::REST_RESOURCE}s" end |
Instance Method Details
#email_address=(email_address) ⇒ Object
56 57 58 |
# File 'lib/quickeebooks/online/model/customer.rb', line 56 def email_address=(email_address) self.email = Quickeebooks::Online::Model::Email.new(email_address) end |
#to_xml_ns(options = {}) ⇒ Object
52 53 54 |
# File 'lib/quickeebooks/online/model/customer.rb', line 52 def to_xml_ns( = {}) to_xml_inject_ns('Customer', ) end |
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields
61 62 63 64 |
# File 'lib/quickeebooks/online/model/customer.rb', line 61 def valid_for_deletion? return false if(id.nil? || sync_token.nil?) id.value.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0 end |
#valid_for_update? ⇒ Boolean
45 46 47 48 49 50 |
# File 'lib/quickeebooks/online/model/customer.rb', line 45 def valid_for_update? if sync_token.nil? errors.add(:sync_token, "Missing required attribute SyncToken for update") end errors.empty? end |