Module: NameEntity::PermitAlterations
- Included in:
- Quickbooks::Model::Class, Quickbooks::Model::CompanyCurrency, Quickbooks::Model::Customer, Quickbooks::Model::Department, Quickbooks::Model::Employee, Quickbooks::Model::PaymentMethod, Quickbooks::Model::Vendor
- Defined in:
- lib/quickbooks/util/name_entity.rb
Instance Method Summary collapse
- #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
#valid_for_create? ⇒ Boolean
74 75 76 77 |
# File 'lib/quickbooks/util/name_entity.rb', line 74 def valid_for_create? valid? errors.empty? end |
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields
80 81 82 83 |
# File 'lib/quickbooks/util/name_entity.rb', line 80 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
67 68 69 70 71 72 |
# File 'lib/quickbooks/util/name_entity.rb', line 67 def valid_for_update? if sync_token.nil? errors.add(:sync_token, "Missing required attribute SyncToken for update") end errors.empty? end |