Class: RediSearch::Search::Term
- Inherits:
-
Object
- Object
- RediSearch::Search::Term
- Includes:
- Validatable
- Defined in:
- lib/redi_search/search/term.rb
Instance Method Summary collapse
-
#initialize(term, field = nil, **options) ⇒ Term
constructor
A new instance of Term.
- #to_s ⇒ Object
Methods included from Validatable
Constructor Details
#initialize(term, field = nil, **options) ⇒ Term
13 14 15 16 17 18 19 |
# File 'lib/redi_search/search/term.rb', line 13 def initialize(term, field = nil, **) @term = term @field = field = validate! end |
Instance Method Details
#to_s ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/redi_search/search/term.rb', line 21 def to_s if term.is_a?(Range) then stringify_range elsif field.is_a?(Schema::TagField) then stringify_tag elsif term.is_a?(Array) then stringify_array else stringify_query end end |