Class: Portage::Ucp::FulfillmentGroup
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::FulfillmentGroup
- 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
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#line_item_ids ⇒ Object
readonly
Returns the value of attribute line_item_ids.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#selected_option_id ⇒ Object
readonly
Returns the value of attribute selected_option_id.
Instance Method Summary collapse
-
#initialize(id:, line_item_ids:, options: [], selected_option_id: nil) ⇒ FulfillmentGroup
constructor
A new instance of FulfillmentGroup.
- #to_wire_h ⇒ Object
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
#id ⇒ Object (readonly)
Returns the value of attribute id
295 296 297 |
# File 'lib/portage/ucp/value_objects.rb', line 295 def id @id end |
#line_item_ids ⇒ Object (readonly)
Returns the value of attribute line_item_ids
295 296 297 |
# File 'lib/portage/ucp/value_objects.rb', line 295 def line_item_ids @line_item_ids end |
#options ⇒ Object (readonly)
Returns the value of attribute options
295 296 297 |
# File 'lib/portage/ucp/value_objects.rb', line 295 def @options end |
#selected_option_id ⇒ Object (readonly)
Returns the value of attribute 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_h ⇒ Object
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" => .map(&:to_wire_h), "selected_option_id" => selected_option_id } end |