Class: UI::SkeletonComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SkeletonComponent
- Defined in:
- app/view_components/ui/skeleton_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**attributes) ⇒ SkeletonComponent
constructor
A new instance of SkeletonComponent.
Constructor Details
#initialize(**attributes) ⇒ SkeletonComponent
Returns a new instance of SkeletonComponent.
4 5 6 |
# File 'app/view_components/ui/skeleton_component.rb', line 4 def initialize(**attributes) @attributes = attributes end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/view_components/ui/skeleton_component.rb', line 8 def call attrs = component_html_attributes.deep_merge(@attributes) # Merge Tailwind classes intelligently attrs[:class] = TailwindMerge::Merger.new.merge([ component_html_attributes[:class], @attributes[:class] ].compact.join(" ")) content_tag :div, "", **attrs end |