Class: HakumiComponents::Mentions::Option

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
app/components/hakumi_components/mentions/option.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelObject (readonly)

Returns the value of attribute label.



16
17
18
# File 'app/components/hakumi_components/mentions/option.rb', line 16

def label
  @label
end

#valueObject (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_hObject



22
23
24
25
26
27
# File 'app/components/hakumi_components/mentions/option.rb', line 22

def to_h
  {
    label: @label,
    value: @value
  }
end