Class: Maglev::Uikit::TabsComponent::Tab
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Maglev::Uikit::TabsComponent::Tab
- Defined in:
- app/components/maglev/uikit/tabs_component.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
writeonly
Sets the attribute active.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #block? ⇒ Boolean
-
#initialize(component, label:, active:, link:, block: nil) ⇒ Tab
constructor
A new instance of Tab.
- #link? ⇒ Boolean
- #link_html_options ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(component, label:, active:, link:, block: nil) ⇒ Tab
Returns a new instance of Tab.
64 65 66 67 68 69 70 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 64 def initialize(component, label:, active:, link:, block: nil) @component = component @label = label @active = active @link = link @block = block end |
Instance Attribute Details
#active=(value) ⇒ Object (writeonly)
Sets the attribute active
62 63 64 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 62 def active=(value) @active = value end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
61 62 63 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 61 def block @block end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
61 62 63 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 61 def label @label end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
61 62 63 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 61 def link @link end |
Instance Method Details
#active? ⇒ Boolean
72 73 74 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 72 def active? @active end |
#block? ⇒ Boolean
76 77 78 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 76 def block? @block.present? end |
#link? ⇒ Boolean
80 81 82 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 80 def link? @link.present? end |
#link_html_options ⇒ Object
84 85 86 |
# File 'app/components/maglev/uikit/tabs_component.rb', line 84 def @link[:html_options] || {} end |