Class: Portage::Ucp::Cart
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::Cart
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/cart.json — requires ucp/id/line_items/currency/totals. The "ucp" envelope is added centrally by Portage::Ucp::WireEnvelope, not stored on the value object itself.
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#line_items ⇒ Object
readonly
Returns the value of attribute line_items.
-
#totals ⇒ Object
readonly
Returns the value of attribute totals.
Instance Method Summary collapse
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency
55 56 57 |
# File 'lib/portage/ucp/value_objects.rb', line 55 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id
55 56 57 |
# File 'lib/portage/ucp/value_objects.rb', line 55 def id @id end |
#line_items ⇒ Object (readonly)
Returns the value of attribute line_items
55 56 57 |
# File 'lib/portage/ucp/value_objects.rb', line 55 def line_items @line_items end |
#totals ⇒ Object (readonly)
Returns the value of attribute totals
55 56 57 |
# File 'lib/portage/ucp/value_objects.rb', line 55 def totals @totals end |
Instance Method Details
#to_wire_h ⇒ Object
56 57 58 59 |
# File 'lib/portage/ucp/value_objects.rb', line 56 def to_wire_h { "id" => id, "line_items" => line_items.map(&:to_wire_h), "currency" => currency, "totals" => totals.map(&:to_wire_h) } end |