Class: Portage::Ucp::OptionValue
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::OptionValue
- 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
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(label:, id: nil) ⇒ OptionValue
constructor
A new instance of OptionValue.
- #to_wire_h ⇒ Object
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
#id ⇒ Object (readonly)
Returns the value of attribute id
51 52 53 |
# File 'lib/portage/ucp/value_objects.rb', line 51 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label
51 52 53 |
# File 'lib/portage/ucp/value_objects.rb', line 51 def label @label end |
Instance Method Details
#to_wire_h ⇒ Object
54 |
# File 'lib/portage/ucp/value_objects.rb', line 54 def to_wire_h = { "id" => id, "label" => label }.compact |