Class: Bs5::Tabs::ItemComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/bs5/tabs/item_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, options = {}) ⇒ ItemComponent

Returns a new instance of ItemComponent.



9
10
11
12
13
# File 'app/components/bs5/tabs/item_component.rb', line 9

def initialize(title, options = {})
  @title = title
  @options = options.symbolize_keys
  extract_options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'app/components/bs5/tabs/item_component.rb', line 6

def options
  @options
end

#styleObject

Returns the value of attribute style.



7
8
9
# File 'app/components/bs5/tabs/item_component.rb', line 7

def style
  @style
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'app/components/bs5/tabs/item_component.rb', line 6

def title
  @title
end

Instance Method Details

#pane_idObject



19
20
21
# File 'app/components/bs5/tabs/item_component.rb', line 19

def pane_id
  "nav-#{object_id}"
end

#tab_idObject



15
16
17
# File 'app/components/bs5/tabs/item_component.rb', line 15

def tab_id
  "nav-#{object_id}-tab"
end