Class: CatalogAPI::OrderItem

Inherits:
Object
  • Object
show all
Defined in:
lib/catalogapi/order_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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_priceObject (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

#currencyObject (readonly)

Returns the value of attribute currency.



5
6
7
# File 'lib/catalogapi/order_item.rb', line 5

def currency
  @currency
end

#metadataObject (readonly)

Returns the value of attribute metadata.



5
6
7
# File 'lib/catalogapi/order_item.rb', line 5

def 
  @metadata
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/catalogapi/order_item.rb', line 5

def name
  @name
end

#optionObject (readonly)

Returns the value of attribute option.



5
6
7
# File 'lib/catalogapi/order_item.rb', line 5

def option
  @option
end

#order_item_idObject (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_statusObject (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_idObject (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

#pointsObject (readonly)

Returns the value of attribute points.



5
6
7
# File 'lib/catalogapi/order_item.rb', line 5

def points
  @points
end