Class: DsfrComponent::HeaderComponent::OperatorImageComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- DsfrComponent::HeaderComponent::OperatorImageComponent
- Defined in:
- app/components/dsfr_component/header_component/operator_image_component.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
- #default_attributes ⇒ Object
-
#initialize(title:, src:, alt:, classes: [], html_attributes: {}) ⇒ OperatorImageComponent
constructor
A new instance of OperatorImageComponent.
Constructor Details
#initialize(title:, src:, alt:, classes: [], html_attributes: {}) ⇒ OperatorImageComponent
Returns a new instance of OperatorImageComponent.
5 6 7 8 9 10 11 |
# File 'app/components/dsfr_component/header_component/operator_image_component.rb', line 5 def initialize(title:, src:, alt:, classes: [], html_attributes: {}) @title = title @src = src @alt = alt super(classes: classes, html_attributes: html_attributes) end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/components/dsfr_component/header_component/operator_image_component.rb', line 13 def call tag.div(class: "fr-header__operator") do tag.a(href: "/", title: title) do tag.img(class: "fr-responsive-img", src: src, alt: alt, style: "max-width:9.0625rem;") end end end |
#default_attributes ⇒ Object
21 22 23 |
# File 'app/components/dsfr_component/header_component/operator_image_component.rb', line 21 def default_attributes {} end |