Module: NameEntity::PermitAlterations
- 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
40 41 42 43 |
# File 'lib/quickbooks/util/name_entity.rb', line 40 def valid_for_create? valid? errors.empty? end |
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields
46 47 48 49 |
# File 'lib/quickbooks/util/name_entity.rb', line 46 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
33 34 35 36 37 38 |
# File 'lib/quickbooks/util/name_entity.rb', line 33 def valid_for_update? if sync_token.nil? errors.add(:sync_token, "Missing required attribute SyncToken for update") end errors.empty? end |