Class: TingYun::Agent::Database::Statement
- Inherits:
-
Object
- Object
- TingYun::Agent::Database::Statement
- Defined in:
- lib/ting_yun/agent/database.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#explainer ⇒ Object
Returns the value of attribute explainer.
-
#sql ⇒ Object
Returns the value of attribute sql.
Instance Method Summary collapse
- #adapter ⇒ Object
-
#initialize(sql, config = {}, explainer = nil) ⇒ Statement
constructor
A new instance of Statement.
Constructor Details
#initialize(sql, config = {}, explainer = nil) ⇒ Statement
Returns a new instance of Statement.
269 270 271 272 273 |
# File 'lib/ting_yun/agent/database.rb', line 269 def initialize(sql, config={}, explainer=nil) @sql = TingYun::Agent::Database.capture_query(sql) @config = config @explainer = explainer end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
267 268 269 |
# File 'lib/ting_yun/agent/database.rb', line 267 def config @config end |
#explainer ⇒ Object
Returns the value of attribute explainer.
267 268 269 |
# File 'lib/ting_yun/agent/database.rb', line 267 def explainer @explainer end |
#sql ⇒ Object
Returns the value of attribute sql.
267 268 269 |
# File 'lib/ting_yun/agent/database.rb', line 267 def sql @sql end |
Instance Method Details
#adapter ⇒ Object
275 276 277 |
# File 'lib/ting_yun/agent/database.rb', line 275 def adapter config && config[:adapter] end |