Class: Geoblacklight::WebServicesLinkComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/geoblacklight/web_services_link_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document:) ⇒ WebServicesLinkComponent

Returns a new instance of WebServicesLinkComponent.



7
8
9
10
# File 'app/components/geoblacklight/web_services_link_component.rb', line 7

def initialize(document:, **)
  @document = document
  super()
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



5
6
7
# File 'app/components/geoblacklight/web_services_link_component.rb', line 5

def document
  @document
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
# File 'app/components/geoblacklight/web_services_link_component.rb', line 12

def call
  link_to(
    "Web services",
    helpers.web_services_solr_document_path(id: document.id),
    class: "nav-link",
    data: {blacklight_modal: "trigger"}
  )
end

#keyObject



21
22
23
# File 'app/components/geoblacklight/web_services_link_component.rb', line 21

def key
  "web_services"
end