class Quickbooks::Model::Item
Constants
- CATEGORY_TYPE
- INVENTORY_TYPE
- ITEM_TYPES
- NON_INVENTORY_TYPE
- REST_RESOURCE
- SERVICE_TYPE
- XML_COLLECTION_NODE
- XML_NODE
Public Class Methods
Source
# File lib/quickbooks/model/item.rb, line 65 def initialize(*args) self.type = INVENTORY_TYPE super end
Calls superclass method
Quickbooks::Model::BaseModel::new
Public Instance Methods
Source
# File lib/quickbooks/model/item.rb, line 70 def valid_for_create? valid? errors.empty? end
Source
# File lib/quickbooks/model/item.rb, line 76 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
To delete an object Intuit requires we provide Id and SyncToken fields
Source
# File lib/quickbooks/model/item.rb, line 81 def valid_for_update? if sync_token.nil? errors.add(:sync_token, "Missing required attribute SyncToken for update") end errors.empty? end