Class: Olivander::Components::TabsComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Olivander::Components::TabsComponent
- Defined in:
- app/components/olivander/components/tabs_component.rb
Overview
component to render tabs
Defined Under Namespace
Classes: Tab
Instance Attribute Summary collapse
-
#card ⇒ Object
readonly
Returns the value of attribute card.
-
#card_class ⇒ Object
readonly
Returns the value of attribute card_class.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#tab_content_id ⇒ Object
readonly
Returns the value of attribute tab_content_id.
-
#tab_strip_id ⇒ Object
readonly
Returns the value of attribute tab_strip_id.
Instance Method Summary collapse
-
#initialize(*args) ⇒ TabsComponent
constructor
A new instance of TabsComponent.
Constructor Details
#initialize(*args) ⇒ TabsComponent
Returns a new instance of TabsComponent.
12 13 14 15 16 17 18 19 20 |
# File 'app/components/olivander/components/tabs_component.rb', line 12 def initialize(*args) super = args. @id = [:id] || "tabs-#{SecureRandom.hex(4)}" @card = .key?(:card) ? !![:card] : true @card_class = .key?(:card_class) ? [:card_class] : 'card-primary' @tab_strip_id = "tab-strip-#{SecureRandom.hex(4)}" @tab_content_id = "tab-strip-#{SecureRandom.hex(4)}" end |
Instance Attribute Details
#card ⇒ Object (readonly)
Returns the value of attribute card.
10 11 12 |
# File 'app/components/olivander/components/tabs_component.rb', line 10 def card @card end |
#card_class ⇒ Object (readonly)
Returns the value of attribute card_class.
10 11 12 |
# File 'app/components/olivander/components/tabs_component.rb', line 10 def card_class @card_class end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'app/components/olivander/components/tabs_component.rb', line 10 def id @id end |
#tab_content_id ⇒ Object (readonly)
Returns the value of attribute tab_content_id.
10 11 12 |
# File 'app/components/olivander/components/tabs_component.rb', line 10 def tab_content_id @tab_content_id end |
#tab_strip_id ⇒ Object (readonly)
Returns the value of attribute tab_strip_id.
10 11 12 |
# File 'app/components/olivander/components/tabs_component.rb', line 10 def tab_strip_id @tab_strip_id end |