class Beaver::LineItem
LineItem
Model.
Attributes
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [CurrencyEnum]
TODO: Write general description for this method @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 [String]
TODO: Write general description for this method @return [ItemNullableResp]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Float]
TODO: Write general description for this method @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 [Integer]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/beaver/models/line_item.rb, line 116 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. currency = hash['currency'] quantity = hash['quantity'] total_amount = hash['total_amount'] unit_price = hash['unit_price'] commodity_code = hash['commodity_code'] description = hash['description'] discount_amount = hash['discount_amount'] discount_indicator = hash['discount_indicator'] gross_net_indicator = hash['gross_net_indicator'] item = ItemNullableResp.from_hash(hash['item']) if hash['item'] tax_amount = hash['tax_amount'] tax_rate = hash['tax_rate'] tax_type_applied = hash['tax_type_applied'] unit_of_measure = hash['unit_of_measure'] # Create object from extracted values. LineItem.new(currency, quantity, total_amount, unit_price, commodity_code, description, discount_amount, discount_indicator, gross_net_indicator, item, tax_amount, tax_rate, tax_type_applied, unit_of_measure) end
A mapping from model property names to API property names.
# File lib/beaver/models/line_item.rb, line 66 def self.names @_hash = {} if @_hash.nil? @_hash['commodity_code'] = 'commodity_code' @_hash['currency'] = 'currency' @_hash['description'] = 'description' @_hash['discount_amount'] = 'discount_amount' @_hash['discount_indicator'] = 'discount_indicator' @_hash['gross_net_indicator'] = 'gross_net_indicator' @_hash['item'] = 'item' @_hash['quantity'] = 'quantity' @_hash['tax_amount'] = 'tax_amount' @_hash['tax_rate'] = 'tax_rate' @_hash['tax_type_applied'] = 'tax_type_applied' @_hash['total_amount'] = 'total_amount' @_hash['unit_of_measure'] = 'unit_of_measure' @_hash['unit_price'] = 'unit_price' @_hash end
# File lib/beaver/models/line_item.rb, line 85 def initialize(currency = nil, quantity = nil, total_amount = nil, unit_price = nil, commodity_code = nil, description = nil, discount_amount = nil, discount_indicator = nil, gross_net_indicator = nil, item = nil, tax_amount = nil, tax_rate = nil, tax_type_applied = nil, unit_of_measure = nil) @commodity_code = commodity_code @currency = currency @description = description @discount_amount = discount_amount @discount_indicator = discount_indicator @gross_net_indicator = gross_net_indicator @item = item @quantity = quantity @tax_amount = tax_amount @tax_rate = tax_rate @tax_type_applied = tax_type_applied @total_amount = total_amount @unit_of_measure = unit_of_measure @unit_price = unit_price end