Class: BlacklightRangeLimit::RangeFormComponent
- Inherits:
-
Blacklight::Component
- Object
- Blacklight::Component
- BlacklightRangeLimit::RangeFormComponent
- Defined in:
- app/components/blacklight_range_limit/range_form_component.rb
Instance Method Summary collapse
- #begin_input_name ⇒ Object
- #begin_value_default ⇒ Object
- #end_input_name ⇒ Object
- #end_value_default ⇒ Object
-
#initialize(facet_field:, classes: BlacklightRangeLimit.classes) ⇒ RangeFormComponent
constructor
A new instance of RangeFormComponent.
Constructor Details
#initialize(facet_field:, classes: BlacklightRangeLimit.classes) ⇒ RangeFormComponent
Returns a new instance of RangeFormComponent.
7 8 9 10 |
# File 'app/components/blacklight_range_limit/range_form_component.rb', line 7 def initialize(facet_field:, classes: BlacklightRangeLimit.classes) @facet_field = facet_field @classes = classes end |
Instance Method Details
#begin_input_name ⇒ Object
20 21 22 |
# File 'app/components/blacklight_range_limit/range_form_component.rb', line 20 def begin_input_name "range[#{@facet_field.key}][begin]" end |
#begin_value_default ⇒ Object
12 13 14 |
# File 'app/components/blacklight_range_limit/range_form_component.rb', line 12 def begin_value_default @facet_field.selected_range.is_a?(Range) ? @facet_field.selected_range.begin : @facet_field.min end |
#end_input_name ⇒ Object
24 25 26 |
# File 'app/components/blacklight_range_limit/range_form_component.rb', line 24 def end_input_name "range[#{@facet_field.key}][end]" end |
#end_value_default ⇒ Object
16 17 18 |
# File 'app/components/blacklight_range_limit/range_form_component.rb', line 16 def end_value_default @facet_field.selected_range.is_a?(Range) ? @facet_field.selected_range.end : @facet_field.max end |