Class: Portage::Ucp::OptionValue

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

Overview

schemas/shopping/types/option_value.json — a selectable value for a ProductOption (e.g. "Blue" under "Color").

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label:, id: nil) ⇒ OptionValue

Returns a new instance of OptionValue.



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

def initialize(label:, id: nil) = super

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



51
52
53
# File 'lib/portage/ucp/value_objects.rb', line 51

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



51
52
53
# File 'lib/portage/ucp/value_objects.rb', line 51

def label
  @label
end

Instance Method Details

#to_wire_hObject



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

def to_wire_h = { "id" => id, "label" => label }.compact