Class: DbMon::Runner
- Inherits:
-
Object
- Object
- DbMon::Runner
- Defined in:
- lib/db_mon/runner.rb
Instance Attribute Summary collapse
-
#monitor ⇒ Object
readonly
Returns the value of attribute monitor.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(options = {}) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/db_mon/runner.rb', line 9 def initialize( = {}) @monitor = nil case ['adapter'] when 'mysql2' require_relative 'mysql_monitor' @monitor = MysqlMonitor.new() when 'pg' require_relative 'pg_monitor' @monitor = PgMonitor.new() when 'sqlite' raise "SQLite Monitor not implemented" @monitor = SqliteMonitor.new() else raise 'Unsupported Adapter' end end |
Instance Attribute Details
#monitor ⇒ Object (readonly)
Returns the value of attribute monitor.
6 7 8 |
# File 'lib/db_mon/runner.rb', line 6 def monitor @monitor end |