Sha256: e87f3366708e384f14364d0c6059b0ad7b351622bda7cd9c1ac9065843b93633
Contents?: true
Size: 761 Bytes
Versions: 6
Compression:
Stored size: 761 Bytes
Contents
# frozen_string_literal: true module BlacklightRangeLimit class RangeSegmentsComponent < Blacklight::Component def initialize(facet_field:, facet_items: nil, item_component: nil, classes: []) super @facet_field = facet_field @facet_items = facet_items || facet_field.try(:range_queries) || [] @item_component = facet_field.facet_field.item_component || Blacklight::FacetItemComponent @classes = classes end def facet_item_presenters @facet_items.map { |item| facet_item_presenter(item) } end def facet_item_presenter(facet_item) facet_config.item_presenter.new(facet_item, facet_config, helpers, @facet_field.key) end def facet_config @facet_field.facet_field end end end
Version data entries
6 entries across 6 versions & 1 rubygems