Class: Geoblacklight::LoginLinkComponent

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

Overview

Display login link

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document:) ⇒ LoginLinkComponent

Returns a new instance of LoginLinkComponent.



8
9
10
11
# File 'app/components/geoblacklight/login_link_component.rb', line 8

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

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



6
7
8
# File 'app/components/geoblacklight/login_link_component.rb', line 6

def document
  @document
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/components/geoblacklight/login_link_component.rb', line 13

def render?
  document.restricted? && document.same_institution? && !helpers.document_available?
end