Class: DsfrComponent::TileComponent
- Defined in:
- app/components/dsfr_component/tile_component.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(title:, url:, image_src: nil, image_alt: "", description: nil, orientation: :vertical, heading_level: 4, classes: [], html_attributes: {}) ⇒ TileComponent
constructor
A new instance of TileComponent.
Constructor Details
#initialize(title:, url:, image_src: nil, image_alt: "", description: nil, orientation: :vertical, heading_level: 4, classes: [], html_attributes: {}) ⇒ TileComponent
Returns a new instance of TileComponent.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/components/dsfr_component/tile_component.rb', line 10 def initialize(title:, url:, image_src: nil, image_alt: "", description: nil, orientation: :vertical, heading_level: 4, classes: [], html_attributes: {}) @title = title @url = url @image_src = image_src @image_alt = image_alt @description = description @orientation = orientation @heading_level = heading_level raise ArgumentError if HEADING_LEVELS.exclude?(heading_level) super(classes: classes, html_attributes: html_attributes) end |