Method: XeroRuby::Accounting::HistoryRecords#to_hash

Defined in:
lib/xero-ruby/models/accounting/history_records.rb

#to_hash(downcase: false) ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



175
176
177
178
179
180
181
182
183
184
# File 'lib/xero-ruby/models/accounting/history_records.rb', line 175

def to_hash(downcase: false)
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    key = downcase ? attr : param
    hash[key] = _to_hash(value, downcase: downcase)
  end
  hash
end