Class: Tabs::DropdownTab::Component

Inherits:
Lookbook::BaseComponent
  • Object
show all
Defined in:
app/components/lookbook/tabs/dropdown_tab/component.rb

Instance Method Summary collapse

Constructor Details

#initialize(name:, label: nil, hotkey: nil, disabled: nil, position: 0, theme: :toolbar, **html_attrs) ⇒ Component

Returns a new instance of Component.



3
4
5
6
7
8
9
10
11
# File 'app/components/lookbook/tabs/dropdown_tab/component.rb', line 3

def initialize(name:, label: nil, hotkey: nil, disabled: nil, position: 0, theme: :toolbar, **html_attrs)
  @name = name
  @label = label
  @hotkey = hotkey
  @disabled = disabled
  @position = position
  @theme = theme
  super(**html_attrs)
end

Instance Method Details

#labelObject



13
14
15
# File 'app/components/lookbook/tabs/dropdown_tab/component.rb', line 13

def label
  @label.presence || content || @name.titleize
end