Class: SystemdMon::Notifiers::Base
- Inherits:
-
Object
- Object
- SystemdMon::Notifiers::Base
- Defined in:
- lib/systemd_mon/notifiers/base.rb
Instance Method Summary collapse
- #debug(message = nil, &blk) ⇒ Object
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
-
#log(message) ⇒ Object
Subclasses can choose to do something when SystemdMon stops E.g.
-
#notify!(notification) ⇒ Object
Subclasses must respond to a unit change.
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
5 6 7 8 |
# File 'lib/systemd_mon/notifiers/base.rb', line 5 def initialize() self. = self.me = self.class.name end |
Instance Method Details
#debug(message = nil, &blk) ⇒ Object
31 32 33 34 |
# File 'lib/systemd_mon/notifiers/base.rb', line 31 def debug( = nil, &blk) = "#{me}: #{message}" if SystemdMon::Logger.debug , &blk end |
#log(message) ⇒ Object
Subclasses can choose to do something when SystemdMon stops E.g. with
def notify_stop!(hostname) end
27 28 29 |
# File 'lib/systemd_mon/notifiers/base.rb', line 27 def log() SystemdMon::Logger.puts "#{me}: #{message}" end |
#notify!(notification) ⇒ Object
Subclasses must respond to a unit change
11 12 13 |
# File 'lib/systemd_mon/notifiers/base.rb', line 11 def notify!(notification) raise "Notifier #{self.class} does not respond to notify!" end |