Class: Adhoq::Executor
- Inherits:
-
Object
- Object
- Adhoq::Executor
- Defined in:
- lib/adhoq/executor.rb,
lib/adhoq/executor/connection_wrapper.rb
Defined Under Namespace
Classes: ConnectionWrapper
Instance Method Summary collapse
- #execute ⇒ Object
- #explain ⇒ Object
-
#initialize(query) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(query) ⇒ Executor
Returns a new instance of Executor.
5 6 7 8 |
# File 'lib/adhoq/executor.rb', line 5 def initialize(query) @connection = ConnectionWrapper.new @query = query end |
Instance Method Details
#execute ⇒ Object
10 11 12 |
# File 'lib/adhoq/executor.rb', line 10 def execute wrap_result(@connection.select(@query)) end |
#explain ⇒ Object
14 15 16 |
# File 'lib/adhoq/executor.rb', line 14 def explain @connection.explain(@query) end |