Class: DbMon::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/db_mon/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  @monitor = nil
  case options['adapter']
  when 'mysql2'
    require_relative 'mysql_monitor'
    @monitor = MysqlMonitor.new(options)
  when 'pg'
    require_relative 'pg_monitor'
    @monitor = PgMonitor.new(options)
  when 'sqlite'
    raise "SQLite Monitor not implemented"
    @monitor = SqliteMonitor.new(options)
  else
    raise 'Unsupported Adapter'
  end

end

Instance Attribute Details

#monitorObject (readonly)

Returns the value of attribute monitor.



6
7
8
# File 'lib/db_mon/runner.rb', line 6

def monitor
  @monitor
end