Class: Blacklight::ConstraintLayoutComponent

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

Direct Known Subclasses

SearchHistoryConstraintLayoutComponent

Constant Summary

Constants inherited from Component

Blacklight::Component::EXCLUDE_VARIABLES

Instance Method Summary collapse

Methods inherited from Component

compiler, config, #inspect

Constructor Details

#initialize(value:, label: nil, remove_path: nil, classes: nil, search_state: nil) ⇒ ConstraintLayoutComponent

Returns a new instance of ConstraintLayoutComponent.



5
6
7
8
9
10
11
# File 'app/components/blacklight/constraint_layout_component.rb', line 5

def initialize(value:, label: nil, remove_path: nil, classes: nil, search_state: nil)
  @value = value
  @label = label
  @remove_path = remove_path
  @classes = Array(classes).join(' ')
  @search_state = search_state
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/components/blacklight/constraint_layout_component.rb', line 13

def render?
  @value.present?
end