Class: Spotlight::Translations::SubheadingComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/spotlight/translations/subheading_component.rb

Overview

Draws a sub-heading for a translation.

Instance Method Summary collapse

Constructor Details

#initialize(key:) ⇒ SubheadingComponent

Returns a new instance of SubheadingComponent.



7
8
9
10
# File 'app/components/spotlight/translations/subheading_component.rb', line 7

def initialize(key:)
  @key = key
  super
end

Instance Method Details

#textObject



12
13
14
# File 'app/components/spotlight/translations/subheading_component.rb', line 12

def text
  t(@key, scope: 'spotlight.translations')
end