Class: ElasticsearchQuery::FilterFormatter::Range
- Defined in:
- lib/elasticsearch_query/filter_formatter/range.rb
Constant Summary collapse
- INFINITY =
'inf'.freeze
- NEGATIVE_INFINITY =
'neginf'.freeze
Class Attribute Summary collapse
-
.parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from ElasticsearchQuery::FilterFormatter::Base
Class Attribute Details
.parser ⇒ Object
Returns the value of attribute parser.
45 46 47 |
# File 'lib/elasticsearch_query/filter_formatter/range.rb', line 45 def parser @parser end |
Instance Method Details
#to_hash ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/elasticsearch_query/filter_formatter/range.rb', line 7 def to_hash return nil if all_the_values? range = {}.tap do |range| range[ :gte ] = beginning unless negative_infinity?( beginning ) range[ :lt ] = ending unless infinity?( ending ) end { range: { @name => range } } end |