Class: Portage::Ucp::FulfillmentGroup

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

Overview

schemas/shopping/types/fulfillment_group.json — a merchant-generated package of line items; the agent sets selected_option_id on update to choose a shipping/pickup rate for that package.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, line_item_ids:, options: [], selected_option_id: nil) ⇒ FulfillmentGroup

Returns a new instance of FulfillmentGroup.



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

def initialize(id:, line_item_ids:, options: [], selected_option_id: nil) = super

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



295
296
297
# File 'lib/portage/ucp/value_objects.rb', line 295

def id
  @id
end

#line_item_idsObject (readonly)

Returns the value of attribute line_item_ids

Returns:

  • (Object)

    the current value of line_item_ids



295
296
297
# File 'lib/portage/ucp/value_objects.rb', line 295

def line_item_ids
  @line_item_ids
end

#optionsObject (readonly)

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



295
296
297
# File 'lib/portage/ucp/value_objects.rb', line 295

def options
  @options
end

#selected_option_idObject (readonly)

Returns the value of attribute selected_option_id

Returns:

  • (Object)

    the current value of selected_option_id



295
296
297
# File 'lib/portage/ucp/value_objects.rb', line 295

def selected_option_id
  @selected_option_id
end

Instance Method Details

#to_wire_hObject



298
299
300
301
# File 'lib/portage/ucp/value_objects.rb', line 298

def to_wire_h
  { "id" => id, "line_item_ids" => line_item_ids, "options" => options.map(&:to_wire_h),
    "selected_option_id" => selected_option_id }
end