class Beaver::Adjustments
Adjustments
Model.
Attributes
TODO: Write general description for this method @return [Integer]
Owner structure to be used in any resource where an account is the owner @return [String]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [Object]
TODO: Write general description for this method @return [String]
Owner structure to be used in any resource where an account is the owner @return [OwnerIsAccount]
Owner structure to be used in any resource where an account is the owner @return [String]
TODO: Write general description for this method @return [Reason]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [TransactionRecordNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [Type7Enum]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/beaver/models/adjustments.rb, line 102 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash['amount'] create_time = hash['create_time'] currency = hash['currency'] id = hash['id'] reason = Reason.from_hash(hash['reason']) if hash['reason'] owner = OwnerIsAccount.from_hash(hash['owner']) if hash['owner'] path = hash['path'] resource = hash['resource'] if hash['txnr_adjustment'] txnr_adjustment = TransactionRecordNonExpanded.from_hash(hash['txnr_adjustment']) end type = hash['type'] custom_data = hash['custom_data'] api_version = hash['api_version'] # Create object from extracted values. Adjustments.new(amount, create_time, currency, id, reason, owner, path, resource, txnr_adjustment, type, custom_data, api_version) end
A mapping from model property names to API property names.
# File lib/beaver/models/adjustments.rb, line 58 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['create_time'] = 'create_time' @_hash['currency'] = 'currency' @_hash['custom_data'] = 'custom_data' @_hash['id'] = 'id' @_hash['reason'] = 'reason' @_hash['owner'] = 'owner' @_hash['path'] = 'path' @_hash['resource'] = 'resource' @_hash['txnr_adjustment'] = 'txnr_adjustment' @_hash['type'] = 'type' @_hash['api_version'] = 'api_version' @_hash end
# File lib/beaver/models/adjustments.rb, line 75 def initialize(amount = nil, create_time = nil, currency = nil, id = nil, reason = nil, owner = nil, path = nil, resource = nil, txnr_adjustment = nil, type = nil, custom_data = nil, api_version = nil) @amount = amount @create_time = create_time @currency = currency @custom_data = custom_data @id = id @reason = reason @owner = owner @path = path @resource = resource @txnr_adjustment = txnr_adjustment @type = type @api_version = api_version end