Class: HakumiComponents::Radio::Group::Option
- Inherits:
-
Object
- Object
- HakumiComponents::Radio::Group::Option
- Extended by:
- T::Sig
- Defined in:
- app/components/hakumi_components/radio/group/option.rb
Instance Attribute Summary collapse
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(label:, value:, disabled: false) ⇒ Option
constructor
A new instance of Option.
- #to_h ⇒ Object
Constructor Details
#initialize(label:, value:, disabled: false) ⇒ Option
Returns a new instance of Option.
17 18 19 20 21 |
# File 'app/components/hakumi_components/radio/group/option.rb', line 17 def initialize(label:, value:, disabled: false) @label = label @value = value @disabled = disabled end |
Instance Attribute Details
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled.
30 31 32 |
# File 'app/components/hakumi_components/radio/group/option.rb', line 30 def disabled @disabled end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
24 25 26 |
# File 'app/components/hakumi_components/radio/group/option.rb', line 24 def label @label end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
27 28 29 |
# File 'app/components/hakumi_components/radio/group/option.rb', line 27 def value @value end |
Instance Method Details
#to_h ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/components/hakumi_components/radio/group/option.rb', line 33 def to_h { label: @label, value: @value, disabled: @disabled } end |