Class: Portage::Ucp::FulfillmentEvent
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::FulfillmentEvent
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/types/fulfillment_event.json — append-only shipment event.
Instance Attribute Summary collapse
-
#carrier ⇒ Object
readonly
Returns the value of attribute carrier.
-
#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.
-
#tracking_number ⇒ Object
readonly
Returns the value of attribute tracking_number.
-
#tracking_url ⇒ Object
readonly
Returns the value of attribute tracking_url.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(id:, occurred_at:, type:, line_items:, tracking_number: nil, tracking_url: nil, carrier: nil, description: nil) ⇒ FulfillmentEvent
constructor
A new instance of FulfillmentEvent.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(id:, occurred_at:, type:, line_items:, tracking_number: nil, tracking_url: nil, carrier: nil, description: nil) ⇒ FulfillmentEvent
Returns a new instance of FulfillmentEvent.
123 124 125 126 |
# File 'lib/portage/ucp/value_objects.rb', line 123 def initialize(id:, occurred_at:, type:, line_items:, tracking_number: nil, tracking_url: nil, carrier: nil, description: nil) super end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def carrier @carrier end |
#description ⇒ Object (readonly)
Returns the value of attribute description
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def id @id end |
#line_items ⇒ Object (readonly)
Returns the value of attribute line_items
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def line_items @line_items end |
#occurred_at ⇒ Object (readonly)
Returns the value of attribute occurred_at
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def occurred_at @occurred_at end |
#tracking_number ⇒ Object (readonly)
Returns the value of attribute tracking_number
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def tracking_number @tracking_number end |
#tracking_url ⇒ Object (readonly)
Returns the value of attribute tracking_url
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def tracking_url @tracking_url end |
#type ⇒ Object (readonly)
Returns the value of attribute type
121 122 123 |
# File 'lib/portage/ucp/value_objects.rb', line 121 def type @type end |
Instance Method Details
#to_wire_h ⇒ Object
128 129 130 131 132 133 134 135 |
# File 'lib/portage/ucp/value_objects.rb', line 128 def to_wire_h h = { "id" => id, "occurred_at" => occurred_at, "type" => type, "line_items" => line_items } h["tracking_number"] = tracking_number if tracking_number h["tracking_url"] = tracking_url if tracking_url h["carrier"] = carrier if carrier h["description"] = description if description h end |