Class: Blacklight::Facets::FiltersComponent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

reset_compiler!, sidecar_files, upstream_sidecar_files

Constructor Details

#initialize(presenter:, classes: 'facet-filters card card-body bg-light p-3 mb-3 border-0') ⇒ FiltersComponent

Returns a new instance of FiltersComponent.

Parameters:



6
7
8
9
# File 'app/components/blacklight/facets/filters_component.rb', line 6

def initialize(presenter:, classes: 'facet-filters card card-body bg-light p-3 mb-3 border-0')
  @presenter = presenter
  @classes = classes
end

Instance Attribute Details

#classesObject (readonly)

Returns the value of attribute classes.



15
16
17
# File 'app/components/blacklight/facets/filters_component.rb', line 15

def classes
  @classes
end

#presenterObject (readonly)

Returns the value of attribute presenter.



15
16
17
# File 'app/components/blacklight/facets/filters_component.rb', line 15

def presenter
  @presenter
end

Instance Method Details

#facetObject



11
12
13
# File 'app/components/blacklight/facets/filters_component.rb', line 11

def facet
  @presenter.facet_field
end

#render?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/components/blacklight/facets/filters_component.rb', line 19

def render?
  facet.suggest != false || render_index_navigation?
end

#render_index_navigation?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/components/blacklight/facets/filters_component.rb', line 23

def render_index_navigation?
  facet.index_range && display_facet.index?
end