Class: Portage::Ucp::Adjustment
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::Adjustment
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/types/adjustment.json — post-order event independent of
fulfillment (refund, return, credit, price_adjustment, dispute,
cancellation, ...). status is pending/completed/failed.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#line_items ⇒ Object
readonly
Returns the value of attribute line_items.
-
#occurred_at ⇒ Object
readonly
Returns the value of attribute occurred_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#totals ⇒ Object
readonly
Returns the value of attribute totals.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(id:, type:, occurred_at:, status:, line_items: nil, totals: nil, description: nil) ⇒ Adjustment
constructor
A new instance of Adjustment.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(id:, type:, occurred_at:, status:, line_items: nil, totals: nil, description: nil) ⇒ Adjustment
Returns a new instance of Adjustment.
154 |
# File 'lib/portage/ucp/value_objects.rb', line 154 def initialize(id:, type:, occurred_at:, status:, line_items: nil, totals: nil, description: nil) = super |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description
153 154 155 |
# File 'lib/portage/ucp/value_objects.rb', line 153 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id
153 154 155 |
# File 'lib/portage/ucp/value_objects.rb', line 153 def id @id end |
#line_items ⇒ Object (readonly)
Returns the value of attribute line_items
153 154 155 |
# File 'lib/portage/ucp/value_objects.rb', line 153 def line_items @line_items end |
#occurred_at ⇒ Object (readonly)
Returns the value of attribute occurred_at
153 154 155 |
# File 'lib/portage/ucp/value_objects.rb', line 153 def occurred_at @occurred_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status
153 154 155 |
# File 'lib/portage/ucp/value_objects.rb', line 153 def status @status end |
#totals ⇒ Object (readonly)
Returns the value of attribute totals
153 154 155 |
# File 'lib/portage/ucp/value_objects.rb', line 153 def totals @totals end |
#type ⇒ Object (readonly)
Returns the value of attribute type
153 154 155 |
# File 'lib/portage/ucp/value_objects.rb', line 153 def type @type end |
Instance Method Details
#to_wire_h ⇒ Object
156 157 158 159 160 161 162 |
# File 'lib/portage/ucp/value_objects.rb', line 156 def to_wire_h h = { "id" => id, "type" => type, "occurred_at" => occurred_at, "status" => status } h["line_items"] = line_items if line_items h["totals"] = totals.map(&:to_wire_h) if totals h["description"] = description if description h end |