Class: DsfrComponent::HeaderComponent::DirectLinkComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/dsfr_component/header_component/direct_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:, active: false, classes: [], html_attributes: {}) ⇒ DirectLinkComponent

Returns a new instance of DirectLinkComponent.



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

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

  super(classes: classes, html_attributes: html_attributes)
end

Instance Method Details

#callObject



10
11
12
# File 'app/components/dsfr_component/header_component/direct_link_component.rb', line 10

def call
  tag.a(title, **html_attributes)
end