class PrettySearch::SimpleQuery
Simple query that matches returns matches when all fields matches fully
Constants
- SIMPLE_PATTERN
Attributes
attr[R]
Public Class Methods
new(attr)
click to toggle source
# File lib/pretty_search/query.rb, line 52 def initialize(attr) @attr = attr end
Public Instance Methods
==(o)
click to toggle source
Used in specs
# File lib/pretty_search/query.rb, line 67 def ==(o) attr == o.attr end
[](key)
click to toggle source
# File lib/pretty_search/query.rb, line 62 def [](key) attr[key] end
match(doc)
click to toggle source
# File lib/pretty_search/query.rb, line 56 def match(doc) attr.all? do |key, value| doc[key] == value # floats are compared as strings end end