Class: Quickeebooks::Online::Model::Item

Inherits:
IntuitType
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/quickeebooks/online/model/item.rb

Constant Summary collapse

XML_NODE =
"Item"
REST_RESOURCE =

<baseURL>/resource/items/v2/<realmID>

"items"

Instance Method Summary collapse

Methods inherited from IntuitType

resource_for_collection, resource_for_singular

Instance Method Details

#taxable?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/quickeebooks/online/model/item.rb', line 46

def taxable?
  taxable == "true"
end

#to_xml_ns(options = {}) ⇒ Object



36
37
38
# File 'lib/quickeebooks/online/model/item.rb', line 36

def to_xml_ns(options = {})
  to_xml_inject_ns('Item', options)
end

#valid_for_deletion?Boolean

To delete a record Intuit requires we provide Id and SyncToken fields

Returns:

  • (Boolean)


41
42
43
44
# File 'lib/quickeebooks/online/model/item.rb', line 41

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