Class: Apolo::Notifiers::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/apolo/notifiers/console.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Console

Returns a new instance of Console.



6
7
8
# File 'lib/apolo/notifiers/console.rb', line 6

def initialize(options = {})
  @show_date = options[:show_date]
end

Instance Method Details

#notify(monitor, message, value) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/apolo/notifiers/console.rb', line 10

def notify(monitor, message, value)
  output = "#{monitor} #{message} #{value}"
  unless @show_date.nil?
    output = "#{DateTime.now} #{output}"
  end
  puts output
end