class MonitoringReporter::MySQL
This is mysql class to request the databse.
Public Class Methods
new(opts)
click to toggle source
Class constructor method
# File lib/monitoringreporter/mysql.rb, line 24 def initialize(opts) @opts = opts @my = Mysql.connect( opts['host'], opts['user'], opts['password'], opts['database'], opts['port'], opts['socket'] ) end
Public Instance Methods
query(query)
click to toggle source
# File lib/monitoringreporter/mysql.rb, line 36 def query(query) @my.query(query).to_a end