Class: Quickeebooks::Online::Model::Payment

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

Constant Summary collapse

XML_NODE =
"Payment"
REST_RESOURCE =
"payment"

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from IntuitType

resource_for_singular

Constructor Details

#initializePayment

Returns a new instance of Payment.



24
25
26
# File 'lib/quickeebooks/online/model/payment.rb', line 24

def initialize
  ensure_line_items_initialization
end

Class Method Details

.resource_for_collectionObject

Class methods



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

def self.resource_for_collection
  "#{self::REST_RESOURCE}s"
end

Instance Method Details

#to_xml_ns(options = {}) ⇒ Object



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

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

#valid_for_deletion?Boolean

Returns:

  • (Boolean)


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

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)


28
29
30
# File 'lib/quickeebooks/online/model/payment.rb', line 28

def valid_for_update?
  errors.empty?
end