Class: Blacklight::Facets::FiltersComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Facets::FiltersComponent
- Defined in:
- app/components/blacklight/facets/filters_component.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
Instance Method Summary collapse
- #facet ⇒ Object
-
#initialize(presenter:, classes: 'facet-filters card card-body bg-light p-3 mb-3 border-0') ⇒ FiltersComponent
constructor
A new instance of FiltersComponent.
- #render? ⇒ Boolean
- #render_index_navigation? ⇒ Boolean
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.
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
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
15 16 17 |
# File 'app/components/blacklight/facets/filters_component.rb', line 15 def classes @classes end |
#presenter ⇒ Object (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
#facet ⇒ Object
11 12 13 |
# File 'app/components/blacklight/facets/filters_component.rb', line 11 def facet @presenter.facet_field end |
#render? ⇒ Boolean
19 20 21 |
# File 'app/components/blacklight/facets/filters_component.rb', line 19 def render? facet.suggest != false || end |
#render_index_navigation? ⇒ Boolean
23 24 25 |
# File 'app/components/blacklight/facets/filters_component.rb', line 23 def facet.index_range && display_facet.index? end |