Class: Portage::Ucp::Expectation

Inherits:
Data
  • Object
show all
Defined in:
lib/portage/ucp/value_objects.rb

Overview

schemas/shopping/types/expectation.json — buyer-facing delivery grouping.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, line_items:, method_type:, destination:, description: nil, fulfillable_on: nil) ⇒ Expectation

Returns a new instance of Expectation.



110
# File 'lib/portage/ucp/value_objects.rb', line 110

def initialize(id:, line_items:, method_type:, destination:, description: nil, fulfillable_on: nil) = super

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



109
110
111
# File 'lib/portage/ucp/value_objects.rb', line 109

def description
  @description
end

#destinationObject (readonly)

Returns the value of attribute destination

Returns:

  • (Object)

    the current value of destination



109
110
111
# File 'lib/portage/ucp/value_objects.rb', line 109

def destination
  @destination
end

#fulfillable_onObject (readonly)

Returns the value of attribute fulfillable_on

Returns:

  • (Object)

    the current value of fulfillable_on



109
110
111
# File 'lib/portage/ucp/value_objects.rb', line 109

def fulfillable_on
  @fulfillable_on
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



109
110
111
# File 'lib/portage/ucp/value_objects.rb', line 109

def id
  @id
end

#line_itemsObject (readonly)

Returns the value of attribute line_items

Returns:

  • (Object)

    the current value of line_items



109
110
111
# File 'lib/portage/ucp/value_objects.rb', line 109

def line_items
  @line_items
end

#method_typeObject (readonly)

Returns the value of attribute method_type

Returns:

  • (Object)

    the current value of method_type



109
110
111
# File 'lib/portage/ucp/value_objects.rb', line 109

def method_type
  @method_type
end

Instance Method Details

#to_wire_hObject



112
113
114
115
116
117
# File 'lib/portage/ucp/value_objects.rb', line 112

def to_wire_h
  h = { "id" => id, "line_items" => line_items, "method_type" => method_type, "destination" => destination }
  h["description"] = description if description
  h["fulfillable_on"] = fulfillable_on if fulfillable_on
  h
end