class Beaver::TransactionRecord

TransactionRecord Model.

Attributes

api_version[RW]

TODO: Write general description for this method @return [String]

create_time[RW]

TODO: Write general description for this method @return [Integer]

currency[RW]

TODO: Write general description for this method @return [CurrencyEnum]

fee_amount[RW]

TODO: Write general description for this method @return [Integer]

gross_amount[RW]

TODO: Write general description for this method @return [Integer]

id[RW]

TODO: Write general description for this method @return [String]

net_amount[RW]

TODO: Write general description for this method @return [Integer]

owner[RW]

TODO: Write general description for this method @return [Owner3]

path[RW]

TODO: Write general description for this method @return [String]

resource[RW]

TODO: Write general description for this method @return [String]

type[RW]

TODO: Write general description for this method @return [Type8Enum]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/transaction_record.rb, line 95
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  create_time = hash['create_time']
  id = hash['id']
  path = hash['path']
  resource = hash['resource']
  currency = hash['currency']
  fee_amount = hash['fee_amount']
  gross_amount = hash['gross_amount']
  net_amount = hash['net_amount']
  owner = Owner3.from_hash(hash['owner']) if hash['owner']
  type = hash['type']
  api_version = hash['api_version']

  # Create object from extracted values.
  TransactionRecord.new(create_time,
                        id,
                        path,
                        resource,
                        currency,
                        fee_amount,
                        gross_amount,
                        net_amount,
                        owner,
                        type,
                        api_version)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/transaction_record.rb, line 54
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['create_time'] = 'create_time'
  @_hash['currency'] = 'currency'
  @_hash['fee_amount'] = 'fee_amount'
  @_hash['gross_amount'] = 'gross_amount'
  @_hash['id'] = 'id'
  @_hash['net_amount'] = 'net_amount'
  @_hash['owner'] = 'owner'
  @_hash['path'] = 'path'
  @_hash['resource'] = 'resource'
  @_hash['type'] = 'type'
  @_hash['api_version'] = 'api_version'
  @_hash
end
new(create_time = nil, id = nil, path = nil, resource = nil, currency = nil, fee_amount = nil, gross_amount = nil, net_amount = nil, owner = nil, type = nil, api_version = nil) click to toggle source
# File lib/beaver/models/transaction_record.rb, line 70
def initialize(create_time = nil,
               id = nil,
               path = nil,
               resource = nil,
               currency = nil,
               fee_amount = nil,
               gross_amount = nil,
               net_amount = nil,
               owner = nil,
               type = nil,
               api_version = nil)
  @create_time = create_time
  @currency = currency
  @fee_amount = fee_amount
  @gross_amount = gross_amount
  @id = id
  @net_amount = net_amount
  @owner = owner
  @path = path
  @resource = resource
  @type = type
  @api_version = api_version
end