Class: Portage::Ucp::LineItem
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::LineItem
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/types/line_item.json — id/item/quantity/totals, not a flat product_id/unit_price/total triple.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#totals ⇒ Object
readonly
Returns the value of attribute totals.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id
34 35 36 |
# File 'lib/portage/ucp/value_objects.rb', line 34 def id @id end |
#item ⇒ Object (readonly)
Returns the value of attribute item
34 35 36 |
# File 'lib/portage/ucp/value_objects.rb', line 34 def item @item end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity
34 35 36 |
# File 'lib/portage/ucp/value_objects.rb', line 34 def quantity @quantity end |
#totals ⇒ Object (readonly)
Returns the value of attribute totals
34 35 36 |
# File 'lib/portage/ucp/value_objects.rb', line 34 def totals @totals end |
Instance Method Details
#to_wire_h ⇒ Object
35 36 37 38 |
# File 'lib/portage/ucp/value_objects.rb', line 35 def to_wire_h { "id" => id, "item" => item.to_wire_h, "quantity" => quantity, "totals" => totals.map(&:to_wire_h) } end |