Class: XeroKiwi::Accounting::PaymentTerm

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/xero_kiwi/accounting/payment_terms.rb

Overview

A single payment term (either bills or sales side).

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource

included, #initialize, #reference?, #to_h

Class Method Details

.from_hash(hash) ⇒ Object



50
51
52
53
54
# File 'lib/xero_kiwi/accounting/payment_terms.rb', line 50

def self.from_hash(hash)
  return nil if hash.nil? || hash.empty?

  new(hash)
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



56
57
58
# File 'lib/xero_kiwi/accounting/payment_terms.rb', line 56

def ==(other)
  other.is_a?(PaymentTerm) && day == other.day && type == other.type
end

#hashObject



61
# File 'lib/xero_kiwi/accounting/payment_terms.rb', line 61

def hash = [self.class, day, type].hash

#inspectObject



63
64
65
# File 'lib/xero_kiwi/accounting/payment_terms.rb', line 63

def inspect
  "#<#{self.class} day=#{day.inspect} type=#{type.inspect}>"
end