Class: Daisy::Layout::HoverGalleryComponent::ImageComponent
- Inherits:
-
LocoMotion::BasicComponent
- Object
- LocoMotion::BaseComponent
- LocoMotion::BasicComponent
- Daisy::Layout::HoverGalleryComponent::ImageComponent
- Defined in:
- app/components/daisy/layout/hover_gallery_component.rb
Overview
Renders a single image inside the hover gallery.
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(src: nil, alt: nil, **kws) ⇒ ImageComponent
constructor
A new instance of ImageComponent.
Methods inherited from LocoMotion::BasicComponent
Constructor Details
#initialize(src: nil, alt: nil, **kws) ⇒ ImageComponent
Returns a new instance of ImageComponent.
50 51 52 53 54 |
# File 'app/components/daisy/layout/hover_gallery_component.rb', line 50 def initialize(src: nil, alt: nil, **kws) super(**kws) @src = src @alt = alt end |
Instance Method Details
#before_render ⇒ Object
56 57 58 59 60 |
# File 'app/components/daisy/layout/hover_gallery_component.rb', line 56 def before_render set_tag_name(:component, :img) add_html(:component, { src: @src, alt: @alt }.compact) super end |