Class: HakumiComponents::Mentions::Option
- Inherits:
-
Object
- Object
- HakumiComponents::Mentions::Option
- Extended by:
- T::Sig
- Defined in:
- app/components/hakumi_components/mentions/option.rb
Instance Attribute Summary collapse
-
#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:) ⇒ Option
constructor
A new instance of Option.
- #to_h ⇒ Object
Constructor Details
#initialize(label:, value:) ⇒ Option
Returns a new instance of Option.
10 11 12 13 |
# File 'app/components/hakumi_components/mentions/option.rb', line 10 def initialize(label:, value:) @label = label @value = value end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
16 17 18 |
# File 'app/components/hakumi_components/mentions/option.rb', line 16 def label @label end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
19 20 21 |
# File 'app/components/hakumi_components/mentions/option.rb', line 19 def value @value end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 27 |
# File 'app/components/hakumi_components/mentions/option.rb', line 22 def to_h { label: @label, value: @value } end |