Class: TingYun::Agent::Database::Statement

Inherits:
Object
  • Object
show all
Defined in:
lib/ting_yun/agent/database.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject

Returns the value of attribute config.



267
268
269
# File 'lib/ting_yun/agent/database.rb', line 267

def config
  @config
end

#explainerObject

Returns the value of attribute explainer.



267
268
269
# File 'lib/ting_yun/agent/database.rb', line 267

def explainer
  @explainer
end

#sqlObject

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

#adapterObject



275
276
277
# File 'lib/ting_yun/agent/database.rb', line 275

def adapter
  config && config[:adapter]
end