Class: Tire::Search::BoostingQuery
- Inherits:
-
Object
- Object
- Tire::Search::BoostingQuery
- Defined in:
- lib/tire/search/query.rb
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ BoostingQuery
constructor
A new instance of BoostingQuery.
- #negative(&block) ⇒ Object
- #positive(&block) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(options = {}, &block) ⇒ BoostingQuery
Returns a new instance of BoostingQuery.
228 229 230 231 232 |
# File 'lib/tire/search/query.rb', line 228 def initialize(={}, &block) = @value = {} block.arity < 1 ? self.instance_eval(&block) : block.call(self) if block_given? end |
Instance Method Details
#negative(&block) ⇒ Object
239 240 241 242 |
# File 'lib/tire/search/query.rb', line 239 def negative(&block) (@value[:negative] ||= []) << Query.new(&block).to_hash @value end |
#positive(&block) ⇒ Object
234 235 236 237 |
# File 'lib/tire/search/query.rb', line 234 def positive(&block) (@value[:positive] ||= []) << Query.new(&block).to_hash @value end |
#to_hash ⇒ Object
244 245 246 |
# File 'lib/tire/search/query.rb', line 244 def to_hash @value.update() end |