Class: Quickeebooks::Online::Model::TrackingClass

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

Constant Summary collapse

XML_NODE =
"Class"
REST_RESOURCE =
"class"

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from IntuitType

resource_for_singular

Methods included from Logging

#log

Class Method Details

.resource_for_collectionObject



37
38
39
# File 'lib/quickeebooks/online/model/tracking_class.rb', line 37

def self.resource_for_collection
  REST_RESOURCE + "es"
end

Instance Method Details

#to_xml_ns(options = {}) ⇒ Object



20
21
22
# File 'lib/quickeebooks/online/model/tracking_class.rb', line 20

def to_xml_ns(options = {})
  to_xml_inject_ns(XML_NODE, options)
end

#valid_for_deletion?Boolean

Returns:

  • (Boolean)


32
33
34
35
# File 'lib/quickeebooks/online/model/tracking_class.rb', line 32

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

Returns:

  • (Boolean)


24
25
26
27
28
29
30
# File 'lib/quickeebooks/online/model/tracking_class.rb', line 24

def valid_for_update?
  if sync_token.nil?
    errors.add(:sync_token, "Missing required attribute SyncToken for update")
  end
  valid?
  errors.empty?
end