Class: Portage::Ucp::FulfillmentAvailableMethod

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

Overview

schemas/shopping/types/fulfillment_available_method.json — an inventory availability hint (preorder/pickup-today/etc.), independent of whether the buyer has actually chosen that method yet.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, line_item_ids:, fulfillable_on: nil, description: nil) ⇒ FulfillmentAvailableMethod

Returns a new instance of FulfillmentAvailableMethod.



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

def initialize(type:, line_item_ids:, fulfillable_on: nil, description: nil) = super

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



326
327
328
# File 'lib/portage/ucp/value_objects.rb', line 326

def description
  @description
end

#fulfillable_onObject (readonly)

Returns the value of attribute fulfillable_on

Returns:

  • (Object)

    the current value of fulfillable_on



326
327
328
# File 'lib/portage/ucp/value_objects.rb', line 326

def fulfillable_on
  @fulfillable_on
end

#line_item_idsObject (readonly)

Returns the value of attribute line_item_ids

Returns:

  • (Object)

    the current value of line_item_ids



326
327
328
# File 'lib/portage/ucp/value_objects.rb', line 326

def line_item_ids
  @line_item_ids
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



326
327
328
# File 'lib/portage/ucp/value_objects.rb', line 326

def type
  @type
end

Instance Method Details

#to_wire_hObject



329
330
331
332
333
334
# File 'lib/portage/ucp/value_objects.rb', line 329

def to_wire_h
  h = { "type" => type, "line_item_ids" => line_item_ids }
  h["fulfillable_on"] = fulfillable_on if fulfillable_on
  h["description"] = description if description
  h
end