Class: Portage::Ucp::Fulfillment

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

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

#eventsObject (readonly)

Returns the value of attribute events

Returns:

  • (Object)

    the current value of events



142
143
144
# File 'lib/portage/ucp/value_objects.rb', line 142

def events
  @events
end

#expectationsObject (readonly)

Returns the value of attribute expectations

Returns:

  • (Object)

    the current value of expectations



142
143
144
# File 'lib/portage/ucp/value_objects.rb', line 142

def expectations
  @expectations
end

Instance Method Details

#to_wire_hObject



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