Class: Quickeebooks::Windows::Model::Clazz
- Inherits:
-
IntuitType
- Object
- IntuitType
- Quickeebooks::Windows::Model::Clazz
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/quickeebooks/windows/model/clazz.rb
Constant Summary collapse
- XML_COLLECTION_NODE =
'Classes'
- XML_NODE =
'Class'
- REST_RESOURCE =
services.intuit.com/sb/customer/v2/<realmID>
"class"
Instance Method Summary collapse
- #active? ⇒ Boolean
- #to_xml_ns(options = {}) ⇒ Object
- #valid_for_create? ⇒ Boolean
-
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields.
- #valid_for_update? ⇒ Boolean
Instance Method Details
#active? ⇒ Boolean
34 35 36 |
# File 'lib/quickeebooks/windows/model/clazz.rb', line 34 def active? active == 'true' end |
#to_xml_ns(options = {}) ⇒ Object
53 54 55 |
# File 'lib/quickeebooks/windows/model/clazz.rb', line 53 def to_xml_ns( = {}) to_xml end |
#valid_for_create? ⇒ Boolean
45 46 47 48 49 50 51 |
# File 'lib/quickeebooks/windows/model/clazz.rb', line 45 def valid_for_create? valid? if type_of.nil? errors.add(:type_of, "Missing required attribute TypeOf for Create") end errors.empty? end |
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields
58 59 60 61 |
# File 'lib/quickeebooks/windows/model/clazz.rb', line 58 def valid_for_deletion? return false if(id.nil? || sync_token.nil?) id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0 end |
#valid_for_update? ⇒ Boolean
38 39 40 41 42 43 |
# File 'lib/quickeebooks/windows/model/clazz.rb', line 38 def valid_for_update? if sync_token.nil? errors.add(:sync_token, "Missing required attribute SyncToken for update") end errors.empty? end |