Class: PaysonAPI::V2::Models::OrderItem

Inherits:
Object
  • Object
show all
Defined in:
lib/payson_api/v2/models/order_item.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#credited_amountObject

Returns the value of attribute credited_amount.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def credited_amount
  @credited_amount
end

#discount_rateObject

Returns the value of attribute discount_rate.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def discount_rate
  @discount_rate
end

#eanObject

Returns the value of attribute ean.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def ean
  @ean
end

#image_uriObject

Returns the value of attribute image_uri.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def image_uri
  @image_uri
end

#item_idObject

Returns the value of attribute item_id.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def item_id
  @item_id
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def name
  @name
end

#quantityObject

Returns the value of attribute quantity.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def quantity
  @quantity
end

#referenceObject

Returns the value of attribute reference.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def reference
  @reference
end

#tax_rateObject

Returns the value of attribute tax_rate.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def tax_rate
  @tax_rate
end

#total_price_excluding_taxObject

Returns the value of attribute total_price_excluding_tax.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def total_price_excluding_tax
  @total_price_excluding_tax
end

#total_price_including_taxObject

Returns the value of attribute total_price_including_tax.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def total_price_including_tax
  @total_price_including_tax
end

#total_tax_amountObject

Returns the value of attribute total_tax_amount.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def total_tax_amount
  @total_tax_amount
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def type
  @type
end

#unit_priceObject

Returns the value of attribute unit_price.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def unit_price
  @unit_price
end

#uriObject

Returns the value of attribute uri.



7
8
9
# File 'lib/payson_api/v2/models/order_item.rb', line 7

def uri
  @uri
end

Class Method Details

.from_hash(hash) ⇒ Object

rubocop:disable Metrics/AbcSize



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/payson_api/v2/models/order_item.rb', line 11

def self.from_hash(hash) # rubocop:disable Metrics/AbcSize
  new.tap do |item|
    item.item_id = hash['itemId']
    item.discount_rate = hash['discountRate']
    item.ean = hash['ean']
    item.image_uri = hash['imageUri']
    item.name = hash['name']
    item.quantity = hash['quantity']
    item.reference = hash['reference']
    item.tax_rate = hash['taxRate']
    item.total_price_excluding_tax = hash['totalPriceExcludingTax']
    item.total_price_including_tax = hash['totalPriceIncludingTax']
    item.total_tax_amount = hash['totalTaxAmount']
    item.credited_amount = hash['creditedAmount']
    item.type = hash['type']
    item.unit_price = hash['unitPrice']
    item.uri = hash['uri']
  end
end