Class: Thebes::Sphinxql::Query
- Inherits:
-
Object
- Object
- Thebes::Sphinxql::Query
- Defined in:
- lib/thebes/sphinxql/query.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(query) ⇒ Query
constructor
A new instance of Query.
- #run ⇒ Object
- #to_sql ⇒ Object
Constructor Details
Class Method Details
.run(query) ⇒ Object
27 28 29 |
# File 'lib/thebes/sphinxql/query.rb', line 27 def run query self.new(query).run end |
Instance Method Details
#run ⇒ Object
10 11 12 |
# File 'lib/thebes/sphinxql/query.rb', line 10 def run @client.query self.to_sql end |
#to_sql ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/thebes/sphinxql/query.rb', line 14 def to_sql case @query when String @query when Array @query.shift % (@query.collect { |q| @client.escape(q) }) end end |