Class: CatalogAPI::OrderItem
- Inherits:
-
Object
- Object
- CatalogAPI::OrderItem
- Defined in:
- lib/catalogapi/order_item.rb
Instance Attribute Summary collapse
-
#catalog_item_id ⇒ Object
readonly
Returns the value of attribute catalog_item_id.
-
#catalog_price ⇒ Object
readonly
Returns the value of attribute catalog_price.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#option ⇒ Object
readonly
Returns the value of attribute option.
-
#order_item_id ⇒ Object
readonly
Returns the value of attribute order_item_id.
-
#order_item_status ⇒ Object
readonly
Returns the value of attribute order_item_status.
-
#order_item_status_id ⇒ Object
readonly
Returns the value of attribute order_item_status_id.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(opts) ⇒ OrderItem
constructor
A new instance of OrderItem.
Constructor Details
#initialize(opts) ⇒ OrderItem
Returns a new instance of OrderItem.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/catalogapi/order_item.rb', line 8 def initialize(opts) @catalog_item_id = opts[:catalog_item_id] @catalog_price = opts[:catalog_price] @currency = opts[:currency] @metadata = opts.dig(:metadata, :Meta).to_a.map { |i| CatalogAPI::Metadata.new(i) } @name = opts[:name] @option = opts[:option] @order_item_id = opts[:order_item_id] @order_item_status = opts[:order_item_status] @order_item_status_id = opts[:order_item_status_id] @points = opts[:points] end |
Instance Attribute Details
#catalog_item_id ⇒ Object (readonly)
Returns the value of attribute catalog_item_id.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def catalog_item_id @catalog_item_id end |
#catalog_price ⇒ Object (readonly)
Returns the value of attribute catalog_price.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def catalog_price @catalog_price end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def currency @currency end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def name @name end |
#option ⇒ Object (readonly)
Returns the value of attribute option.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def option @option end |
#order_item_id ⇒ Object (readonly)
Returns the value of attribute order_item_id.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def order_item_id @order_item_id end |
#order_item_status ⇒ Object (readonly)
Returns the value of attribute order_item_status.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def order_item_status @order_item_status end |
#order_item_status_id ⇒ Object (readonly)
Returns the value of attribute order_item_status_id.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def order_item_status_id @order_item_status_id end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
5 6 7 |
# File 'lib/catalogapi/order_item.rb', line 5 def points @points end |