Class: DsfrComponent::HeaderComponent::ToolLinkComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/dsfr_component/header_component/tool_link_component.rb

Constant Summary

Constants inherited from Base

Base::HEADING_LEVELS

Instance Attribute Summary

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Constructor Details

#initialize(title:, path:, classes: [], html_attributes: {}) ⇒ ToolLinkComponent

Returns a new instance of ToolLinkComponent.



2
3
4
5
6
7
# File 'app/components/dsfr_component/header_component/tool_link_component.rb', line 2

def initialize(title:, path:, classes: [], html_attributes: {})
  @title = title
  @path = path

  super(classes: classes, html_attributes: html_attributes)
end

Instance Method Details

#callObject



9
10
11
# File 'app/components/dsfr_component/header_component/tool_link_component.rb', line 9

def call
  tag.a title, href: path, **html_attributes
end