Class: Portage::Ucp::SelectedOption

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

Overview

schemas/shopping/types/selected_option.json — which OptionValue a Variant actually carries for a given option (e.g. Size: Large).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, label:, id: nil) ⇒ SelectedOption

Returns a new instance of SelectedOption.



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

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



64
65
66
# File 'lib/portage/ucp/value_objects.rb', line 64

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



64
65
66
# File 'lib/portage/ucp/value_objects.rb', line 64

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



64
65
66
# File 'lib/portage/ucp/value_objects.rb', line 64

def name
  @name
end

Instance Method Details

#to_wire_hObject



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

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