Class: Daisy::DataDisplay::DiffComponent::ItemComponent
- Inherits:
-
LocoMotion::BasicComponent
- Object
- LocoMotion::BaseComponent
- LocoMotion::BasicComponent
- Daisy::DataDisplay::DiffComponent::ItemComponent
- Defined in:
- app/components/daisy/data_display/diff_component.rb
Overview
A component for rendering individual items within the diff comparison.
Constant Summary collapse
- ITEM_CLASSES =
Full class name strings are required here so Tailwind's scanner can detect them. String interpolation or comments are skipped by the Ruby extractor in Tailwind v4+.
%w[diff-item-1 diff-item-2].freeze
Instance Method Summary collapse
-
#before_render ⇒ Object
rubocop:enable Naming/AccessorMethodName.
-
#set_index(index) ⇒ Object
rubocop:disable Naming/AccessorMethodName.
Methods inherited from LocoMotion::BasicComponent
Instance Method Details
#before_render ⇒ Object
rubocop:enable Naming/AccessorMethodName
59 60 61 |
# File 'app/components/daisy/data_display/diff_component.rb', line 59 def before_render add_css(:component, ITEM_CLASSES[@index - 1]) end |
#set_index(index) ⇒ Object
rubocop:disable Naming/AccessorMethodName
54 55 56 |
# File 'app/components/daisy/data_display/diff_component.rb', line 54 def set_index(index) @index = index end |