Method: Anchor::FilterComponent#initialize
- Defined in:
- app/components/anchor/filter_component.rb
#initialize(label:, options:, param_key:, selected: FROM_REQUEST, type: TYPE_DEFAULT, default_selected: false, **kwargs) ⇒ FilterComponent
Returns a new instance of FilterComponent.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/components/anchor/filter_component.rb', line 7 def initialize( label:, options:, param_key:, selected: FROM_REQUEST, type: TYPE_DEFAULT, default_selected: false, **kwargs ) @label = label @blank_option = .detect { |_text, value| value.nil? } @every_option = @options = - [blank_option] @param_key = param_key @selected = selected @type = fetch_or_fallback(TYPE_OPTIONS, type, TYPE_DEFAULT) @default_selected = default_selected super(**kwargs) end |