Class: Redis::Commands::Search::RangePredicate
- Defined in:
- lib/redis/commands/modules/search/query.rb
Overview
A numeric-range predicate rendering (@field:[min max]).
Constant Summary
Constants inherited from Predicate
Predicate::TAG_ESCAPE_PATTERN, Predicate::TAG_SPECIAL_CHARACTERS, Predicate::TEXT_ESCAPE_PATTERN, Predicate::TEXT_SPECIAL_CHARACTERS
Instance Attribute Summary
Attributes inherited from Predicate
Instance Method Summary collapse
-
#initialize(field, min, max) ⇒ RangePredicate
constructor
A new instance of RangePredicate.
-
#to_s ⇒ String
The query-string fragment, e.g.
Constructor Details
#initialize(field, min, max) ⇒ RangePredicate
Returns a new instance of RangePredicate.
698 699 700 701 702 |
# File 'lib/redis/commands/modules/search/query.rb', line 698 def initialize(field, min, max) super(field) @min = min @max = max end |
Instance Method Details
#to_s ⇒ String
Returns the query-string fragment, e.g. (@price:[10 20]).
705 706 707 |
# File 'lib/redis/commands/modules/search/query.rb', line 705 def to_s "(@#{@field}:[#{@min} #{@max}])" end |