Class: SdrViewComponents::Structure::HeaderSubtitleComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- SdrViewComponents::Structure::HeaderSubtitleComponent
- Defined in:
- app/components/sdr_view_components/structure/header_subtitle_component.rb
Overview
Component for rendering page header subtitle.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(subtitle:) ⇒ HeaderSubtitleComponent
constructor
param subtitle [String] Subtitle text.
- #render? ⇒ Boolean
Methods inherited from BaseComponent
#args_for, #merge_actions, #merge_classes
Constructor Details
#initialize(subtitle:) ⇒ HeaderSubtitleComponent
param subtitle [String] Subtitle text.
8 9 10 11 |
# File 'app/components/sdr_view_components/structure/header_subtitle_component.rb', line 8 def initialize(subtitle:) @subtitle = subtitle super() end |
Instance Method Details
#call ⇒ Object
13 14 15 |
# File 'app/components/sdr_view_components/structure/header_subtitle_component.rb', line 13 def call tag.span @subtitle, class: 'h4 d-block my-1' end |
#render? ⇒ Boolean
17 18 19 |
# File 'app/components/sdr_view_components/structure/header_subtitle_component.rb', line 17 def render? @subtitle.present? end |