Class: Eson::Search::Fuzzy
- Inherits:
-
Object
- Object
- Eson::Search::Fuzzy
- Includes:
- Query
- Defined in:
- lib/eson/search/fuzzy.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#fuzzy { ... } ⇒ self
Generates a ‘fuzzy` query in a query context.
-
#initialize(*args) ⇒ Fuzzy
constructor
A new instance of Fuzzy.
- #to_query_hash ⇒ Object
Methods included from Query
Constructor Details
#initialize(*args) ⇒ Fuzzy
Returns a new instance of Fuzzy.
12 13 14 15 16 17 18 |
# File 'lib/eson/search/fuzzy.rb', line 12 def initialize(*args) if args.length == 1 self. = args.first else self.field = QueryField.new(*args) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Eson::Search::Query
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
9 10 11 |
# File 'lib/eson/search/fuzzy.rb', line 9 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/eson/search/fuzzy.rb', line 10 def @options end |
Instance Method Details
#fuzzy { ... } ⇒ self
7 |
# File 'lib/eson/search/fuzzy.rb', line 7 short_name :fuzzy |
#to_query_hash ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/eson/search/fuzzy.rb', line 20 def to_query_hash if field {name => field.to_query_hash} else {name => } end end |