Class: Quickeebooks::Windows::Model::Account
- Inherits:
-
IntuitType
- Object
- IntuitType
- Quickeebooks::Windows::Model::Account
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/quickeebooks/windows/model/account.rb
Constant Summary collapse
- XML_COLLECTION_NODE =
'Accounts'
- XML_NODE =
'Account'
- REST_RESOURCE =
services.intuit.com/sb/account/v2/<realmID>
"account"
Instance Method Summary collapse
-
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields.
- #valid_for_update? ⇒ Boolean
Methods included from Logging
Instance Method Details
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields
54 55 56 57 |
# File 'lib/quickeebooks/windows/model/account.rb', line 54 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
45 46 47 48 49 50 51 |
# File 'lib/quickeebooks/windows/model/account.rb', line 45 def valid_for_update? if sync_token.nil? errors.add(:sync_token, "Missing required attribute SyncToken for update") end valid? errors.empty? end |