Module: NameEntity::PermitAlterations
- Defined in:
- lib/quickbooks/util/name_entity.rb
Instance Method Summary collapse
- #active? ⇒ Boolean
- #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
32 33 34 |
# File 'lib/quickbooks/util/name_entity.rb', line 32 def active? active.to_s == 'true' end |
#valid_for_create? ⇒ Boolean
43 44 45 46 |
# File 'lib/quickbooks/util/name_entity.rb', line 43 def valid_for_create? valid? errors.empty? end |
#valid_for_deletion? ⇒ Boolean
To delete an account Intuit requires we provide Id and SyncToken fields
49 50 51 52 |
# File 'lib/quickbooks/util/name_entity.rb', line 49 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
36 37 38 39 40 41 |
# File 'lib/quickbooks/util/name_entity.rb', line 36 def valid_for_update? if sync_token.nil? errors.add(:sync_token, "Missing required attribute SyncToken for update") end errors.empty? end |