class Beaver::LineItem1

LineItem1 Model.

Attributes

commodity_code[RW]

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

currency[RW]

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

description[RW]

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

discount_amount[RW]

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

discount_indicator[RW]

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

gross_net_indicator[RW]

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

item[RW]

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

quantity[RW]

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

tax_amount[RW]

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

tax_rate[RW]

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

tax_type_applied[RW]

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

total_amount[RW]

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

unit_of_measure[RW]

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

unit_price[RW]

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

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/line_item1.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 = ItemNullableReq.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.
  LineItem1.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
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/line_item1.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
new(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) click to toggle source
# File lib/beaver/models/line_item1.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