Class: Blacklight::SkipLinkItemComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/blacklight/skip_link_item_component.rb

Instance Method Summary collapse

Methods inherited from Component

reset_compiler!, sidecar_files, upstream_sidecar_files

Constructor Details

#initialize(text:, href:) ⇒ SkipLinkItemComponent

Returns a new instance of SkipLinkItemComponent.



5
6
7
8
# File 'app/components/blacklight/skip_link_item_component.rb', line 5

def initialize(text:, href:)
  @text = text
  @href = href
end

Instance Method Details

#callObject



10
11
12
# File 'app/components/blacklight/skip_link_item_component.rb', line 10

def call
  link_to @text, @href, class: link_classes
end


14
15
16
# File 'app/components/blacklight/skip_link_item_component.rb', line 14

def link_classes
  'd-inline-flex py-2 px-3'
end