Class: Arclight::OnlineStatusIndicatorComponent
- Inherits:
-
Blacklight::Component
- Object
- Blacklight::Component
- Arclight::OnlineStatusIndicatorComponent
- Defined in:
- app/components/arclight/online_status_indicator_component.rb
Overview
Render an online status indicator for a document
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(document:) ⇒ OnlineStatusIndicatorComponent
constructor
A new instance of OnlineStatusIndicatorComponent.
- #render? ⇒ Boolean
Constructor Details
#initialize(document:) ⇒ OnlineStatusIndicatorComponent
Returns a new instance of OnlineStatusIndicatorComponent.
6 7 8 9 |
# File 'app/components/arclight/online_status_indicator_component.rb', line 6 def initialize(document:, **) @document = document super end |
Instance Method Details
#call ⇒ Object
15 16 17 |
# File 'app/components/arclight/online_status_indicator_component.rb', line 15 def call tag.span helpers.blacklight_icon(:online), class: 'al-online-content-icon' end |
#render? ⇒ Boolean
11 12 13 |
# File 'app/components/arclight/online_status_indicator_component.rb', line 11 def render? @document.online_content? end |