Class: Olivander::Components::TabsComponent::Tab
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Olivander::Components::TabsComponent::Tab
- Defined in:
- app/components/olivander/components/tabs_component.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(title:, id: "tab-#{SecureRandom.hex(6)}", active: false) ⇒ Tab
constructor
A new instance of Tab.
Constructor Details
#initialize(title:, id: "tab-#{SecureRandom.hex(6)}", active: false) ⇒ Tab
Returns a new instance of Tab.
25 26 27 28 29 30 |
# File 'app/components/olivander/components/tabs_component.rb', line 25 def initialize(title:, id: "tab-#{SecureRandom.hex(6)}", active: false) super @title = title @id = id @active = active end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
23 24 25 |
# File 'app/components/olivander/components/tabs_component.rb', line 23 def active @active end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23 24 25 |
# File 'app/components/olivander/components/tabs_component.rb', line 23 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
23 24 25 |
# File 'app/components/olivander/components/tabs_component.rb', line 23 def title @title end |
Instance Method Details
#call ⇒ Object
32 33 34 |
# File 'app/components/olivander/components/tabs_component.rb', line 32 def call content end |