Class: Daisy::DataDisplay::TextRotateComponent::ItemComponent
- Inherits:
-
LocoMotion::BasicComponent
- Object
- LocoMotion::BaseComponent
- LocoMotion::BasicComponent
- Daisy::DataDisplay::TextRotateComponent::ItemComponent
- Defined in:
- app/components/daisy/data_display/text_rotate_component.rb
Overview
Renders an individual text item within the rotation. Supports optional links (via LocoMotion::Concerns::LinkableComponent) and icons (via LocoMotion::Concerns::IconableComponent).
Instance Method Summary collapse
-
#before_render ⇒ Object
Runs item-specific setup before rendering.
-
#call ⇒ Object
Renders the item, including optional left/right icons around the content.
-
#initialize(**kws, &block) ⇒ ItemComponent
constructor
Creates a new Text Rotate item.
Methods included from LocoMotion::Concerns::IconableComponent
#has_icons?, #left_icon_html, #render_left_icon, #render_right_icon, #right_icon_html
Methods inherited from LocoMotion::BasicComponent
Constructor Details
#initialize(**kws, &block) ⇒ ItemComponent
Creates a new Text Rotate item.
rubocop:disable Lint/UselessMethodDefinition
138 139 140 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 138 def initialize(**kws, &block) super end |
Instance Method Details
#before_render ⇒ Object
Runs item-specific setup before rendering. Runs before super so that
LinkableComponent can override the tag name to <a> when an href is set.
147 148 149 150 151 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 147 def before_render setup_component super end |
#call ⇒ Object
Renders the item, including optional left/right icons around the content.
156 157 158 159 160 161 162 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 156 def call part(:component) do concat(render_left_icon) concat(content) concat(render_right_icon) end end |