Class: Murakumo::ActivityCheckNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/srv/murakumo_activity_check_notifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(address, name, logger, options) ⇒ ActivityCheckNotifier

Returns a new instance of ActivityCheckNotifier.



8
9
10
11
12
13
14
15
16
17
# File 'lib/srv/murakumo_activity_check_notifier.rb', line 8

def initialize(address, name, logger, options)
  @address = address
  @name = name
  @logger = logger
  @args = options[:args]
  @sender = options[:sender]
  @recipients = options[:recipients]
  @open_timeout = options[:open_timeout]
  @read_timeout = options[:read_timeout]
end

Instance Method Details

#notify_activeObject



19
20
21
# File 'lib/srv/murakumo_activity_check_notifier.rb', line 19

def notify_active
  notify('active', "#{@name} became active.")
end

#notify_inactiveObject



23
24
25
# File 'lib/srv/murakumo_activity_check_notifier.rb', line 23

def notify_inactive
  notify('inactive', "#{@name} became inactive. Zzz...")
end