Class: Blacklight::Hierarchy::SelectedQfacetValueComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/blacklight/hierarchy/selected_qfacet_value_component.rb

Overview

Standard display of a SELECTED facet value, no link, special span with class, and ‘remove’ button.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field_name:, item:) ⇒ SelectedQfacetValueComponent

Returns a new instance of SelectedQfacetValueComponent.



7
8
9
10
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 7

def initialize(field_name:, item:)
  @field_name = field_name
  @item = item
end

Instance Attribute Details

#field_nameObject (readonly)

Returns the value of attribute field_name.



12
13
14
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 12

def field_name
  @field_name
end

#itemObject (readonly)

Returns the value of attribute item.



12
13
14
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 12

def item
  @item
end

Instance Method Details

#remove_hrefObject



14
15
16
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 14

def remove_href
  helpers.search_action_path(helpers.search_state.filter(field_name).remove(item.qvalue).params)
end