Class: Workarea::Orderbot::Order::Item
- Inherits:
-
Object
- Object
- Workarea::Orderbot::Order::Item
- Defined in:
- app/services/workarea/orderbot/order/item.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(item, options = {}) ⇒ Item
constructor
A new instance of Item.
- #to_h ⇒ Object
Constructor Details
#initialize(item, options = {}) ⇒ Item
Returns a new instance of Item.
7 8 9 10 |
# File 'app/services/workarea/orderbot/order/item.rb', line 7 def initialize(item, = {}) @item = item @options = end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
5 6 7 |
# File 'app/services/workarea/orderbot/order/item.rb', line 5 def item @item end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'app/services/workarea/orderbot/order/item.rb', line 5 def @options end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/services/workarea/orderbot/order/item.rb', line 12 def to_h { order_line_id: item.id.to_s, sku: item.sku, quantity: item.quantity, unit_price: item.original_unit_price.to_f, discount: item_discount, total: item.total_value.to_f, tax_total: item_tax_total, order_product_taxes: taxes } end |