Class: Geoblacklight::WebServicesLinkComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Geoblacklight::WebServicesLinkComponent
- Defined in:
- app/components/geoblacklight/web_services_link_component.rb
Instance Method Summary collapse
-
#initialize(document:) ⇒ WebServicesLinkComponent
constructor
A new instance of WebServicesLinkComponent.
- #render? ⇒ Boolean
- #web_services_link ⇒ Object
Constructor Details
#initialize(document:) ⇒ WebServicesLinkComponent
Returns a new instance of WebServicesLinkComponent.
5 6 7 8 |
# File 'app/components/geoblacklight/web_services_link_component.rb', line 5 def initialize(document:) @document = document super() end |
Instance Method Details
#render? ⇒ Boolean
10 11 12 |
# File 'app/components/geoblacklight/web_services_link_component.rb', line 10 def render? (Settings.WEBSERVICES_SHOWN & @document.references.refs.map(&:type).map(&:to_s)).any? end |
#web_services_link ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/components/geoblacklight/web_services_link_component.rb', line 14 def web_services_link link_to "Web services", helpers.web_services_solr_document_path(id: @document.id), class: ["btn", "btn-primary", "sidebar-btn"], id: "web-services-button", data: {blacklight_modal: "trigger"} end |