Class: SnFilterable::ChipsComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
FilteredHelper
Defined in:
app/components/sn_filterable/chips_component.rb

Overview

Handles rendering of the chips for the filters

Instance Method Summary collapse

Methods included from FilteredHelper

#add_filter_url, #clear_all_url, #clear_filter_url, #clear_sort_url, #filtered_form_inputs, #filtered_form_with, #filtered_paginate, #remove_filter_url, #remove_sub_filter_url, #set_filter_url, #sort_url, #table_header_sort_link

Constructor Details

#initialize(filtered:, filters:, url:) ⇒ ChipsComponent

Returns a new instance of ChipsComponent.

Parameters:

  • filtered (Filtered)

    The filtered instance

  • filters (Array<Hash>)

    An array of the filters’ info

  • url (String)

    The base URL of where the filters are displayed



9
10
11
12
13
14
# File 'app/components/sn_filterable/chips_component.rb', line 9

def initialize(filtered:, filters:, url:)
  @filtered = filtered
  @filters = filters
  @url = url
  @known_filters = parsed_filters
end