Class: SdrViewComponents::Structure::HeaderSubtitleComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/sdr_view_components/structure/header_subtitle_component.rb

Overview

Component for rendering page header subtitle.

Instance Method Summary collapse

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

#callObject



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

Returns:

  • (Boolean)


17
18
19
# File 'app/components/sdr_view_components/structure/header_subtitle_component.rb', line 17

def render?
  @subtitle.present?
end