Class: Portage::Ucp::Fulfillment
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::Fulfillment
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/order.json#/properties/fulfillment — no required inner fields (expectations/events are both optional), so an adapter that doesn't model buyer-facing delivery expectations yet can pass Fulfillment.new and still be schema-conformant.
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#expectations ⇒ Object
readonly
Returns the value of attribute expectations.
Instance Method Summary collapse
-
#initialize(expectations: [], events: []) ⇒ Fulfillment
constructor
A new instance of Fulfillment.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(expectations: [], events: []) ⇒ Fulfillment
Returns a new instance of Fulfillment.
143 |
# File 'lib/portage/ucp/value_objects.rb', line 143 def initialize(expectations: [], events: []) = super |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events
142 143 144 |
# File 'lib/portage/ucp/value_objects.rb', line 142 def events @events end |
#expectations ⇒ Object (readonly)
Returns the value of attribute expectations
142 143 144 |
# File 'lib/portage/ucp/value_objects.rb', line 142 def expectations @expectations end |
Instance Method Details
#to_wire_h ⇒ Object
145 146 147 |
# File 'lib/portage/ucp/value_objects.rb', line 145 def to_wire_h { "expectations" => expectations.map(&:to_wire_h), "events" => events.map(&:to_wire_h) } end |