Class: ThinkingSphinx::Masks::ScopesMask
- Inherits:
-
Object
- Object
- ThinkingSphinx::Masks::ScopesMask
show all
- Defined in:
- lib/thinking_sphinx/masks/scopes_mask.rb
Instance Method Summary
collapse
Constructor Details
#initialize(search) ⇒ ScopesMask
Returns a new instance of ScopesMask.
4
5
6
|
# File 'lib/thinking_sphinx/masks/scopes_mask.rb', line 4
def initialize(search)
@search = search
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
49
50
51
|
# File 'lib/thinking_sphinx/masks/scopes_mask.rb', line 49
def method_missing(method, *args, &block)
apply_scope method, *args
end
|
Instance Method Details
#can_handle?(method) ⇒ Boolean
8
9
10
|
# File 'lib/thinking_sphinx/masks/scopes_mask.rb', line 8
def can_handle?(method)
public_methods(false).include?(method) || can_apply_scope?(method)
end
|
#facets(query = nil, options = {}) ⇒ Object
#none ⇒ Object
Also known as:
search_none
#search(query = nil, options = {}) ⇒ Object
19
20
21
22
|
# File 'lib/thinking_sphinx/masks/scopes_mask.rb', line 19
def search(query = nil, options = {})
query, options = nil, query if query.is_a?(Hash)
ThinkingSphinx::Search::Merger.new(@search).merge! query, options
end
|
#search_for_ids(query = nil, options = {}) ⇒ Object
24
25
26
27
|
# File 'lib/thinking_sphinx/masks/scopes_mask.rb', line 24
def search_for_ids(query = nil, options = {})
query, options = nil, query if query.is_a?(Hash)
search query, options.merge(:ids_only => true)
end
|