Class: Primer::TextComponent
- Defined in:
- app/components/primer/text_component.rb
Overview
The Text component is a wrapper component that will apply typography styles to the text inside.
Constant Summary
Constants inherited from Component
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ TextComponent
constructor
A new instance of TextComponent.
Methods inherited from Component
Methods included from ViewHelper
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(**system_arguments) ⇒ TextComponent
Returns a new instance of TextComponent.
11 12 13 14 |
# File 'app/components/primer/text_component.rb', line 11 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] ||= :span end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'app/components/primer/text_component.rb', line 16 def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end |