Class: Stretchy::Filters::RangeFilter
- Defined in:
- lib/stretchy/filters/range_filter.rb
Constant Summary
Constants included from Utils::Contract
Utils::Contract::ASSERTIONS, Utils::Contract::DECAY_FUNCTIONS, Utils::Contract::DISTANCE_FORMAT
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RangeFilter
constructor
A new instance of RangeFilter.
- #to_search ⇒ Object
Methods included from Utils::Contract
included, #require_one, #validate!
Constructor Details
#initialize(options = {}) ⇒ RangeFilter
Returns a new instance of RangeFilter.
11 12 13 14 15 |
# File 'lib/stretchy/filters/range_filter.rb', line 11 def initialize( = {}) @field = [:field] @range = [:stretchy_range] || Stretchy::Types::Range.new() validate! end |
Instance Method Details
#to_search ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/stretchy/filters/range_filter.rb', line 17 def to_search { range: { @field => @range.to_search } } end |