Class: Maglev::Uikit::Form::Combobox::OptionComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/maglev/uikit/form/combobox/option_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, label:) ⇒ OptionComponent

Returns a new instance of OptionComponent.



10
11
12
13
# File 'app/components/maglev/uikit/form/combobox/option_component.rb', line 10

def initialize(id:, label:)
  @id = id
  @label = label
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'app/components/maglev/uikit/form/combobox/option_component.rb', line 8

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



8
9
10
# File 'app/components/maglev/uikit/form/combobox/option_component.rb', line 8

def label
  @label
end

Instance Method Details

#to_argsObject



15
16
17
# File 'app/components/maglev/uikit/form/combobox/option_component.rb', line 15

def to_args
  { id: id, label: label }
end