Class: MongoSearch::Builder
- Inherits:
-
Object
- Object
- MongoSearch::Builder
- Defined in:
- lib/mongo-search/builder.rb
Instance Method Summary collapse
- #exact(attr) ⇒ Object
- #greater_than(attr, opts = nil) ⇒ Object
-
#initialize(search) ⇒ Builder
constructor
A new instance of Builder.
- #intersect(attr) ⇒ Object
- #less_than(attr, opts = nil) ⇒ Object
- #match(attr) ⇒ Object
- #sort_with(attr, opts = nil) ⇒ Object
Constructor Details
#initialize(search) ⇒ Builder
Returns a new instance of Builder.
3 4 5 |
# File 'lib/mongo-search/builder.rb', line 3 def initialize(search) @search = search end |
Instance Method Details
#exact(attr) ⇒ Object
11 12 13 |
# File 'lib/mongo-search/builder.rb', line 11 def exact(attr) @search << Matchers::ExactMatcher.new(attr) end |
#greater_than(attr, opts = nil) ⇒ Object
19 20 21 |
# File 'lib/mongo-search/builder.rb', line 19 def greater_than(attr, opts = nil) @search << Matchers::GreaterThanMatcher.new(attr, opts) end |
#intersect(attr) ⇒ Object
15 16 17 |
# File 'lib/mongo-search/builder.rb', line 15 def intersect(attr) @search << Matchers::IntersectMatcher.new(attr) end |
#less_than(attr, opts = nil) ⇒ Object
23 24 25 |
# File 'lib/mongo-search/builder.rb', line 23 def less_than(attr, opts = nil) @search << Matchers::LessThanMatcher.new(attr, opts) end |
#match(attr) ⇒ Object
7 8 9 |
# File 'lib/mongo-search/builder.rb', line 7 def match(attr) @search << Matchers::PartialMatcher.new(attr) end |