Class: Vayacondios::LogNotifier
- Inherits:
-
Notifier
- Object
- Vayacondios
- Notifier
- Vayacondios::LogNotifier
- Defined in:
- lib/vayacondios/client/notifier.rb
Constant Summary
Constants inherited from Vayacondios
Instance Attribute Summary
Attributes inherited from Notifier
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ LogNotifier
constructor
A new instance of LogNotifier.
- #notify(topic, cargo = {}) ⇒ Object
Methods inherited from Notifier
Methods inherited from Vayacondios
default_notifier, force_legacy_mode, legacy_switch
Methods included from Notifications
Constructor Details
#initialize(options = {}) ⇒ LogNotifier
Returns a new instance of LogNotifier.
32 33 34 |
# File 'lib/vayacondios/client/notifier.rb', line 32 def initialize( = {}) @client = [:log] || Log end |
Instance Method Details
#notify(topic, cargo = {}) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/vayacondios/client/notifier.rb', line 36 def notify(topic, cargo = {}) prepped = prepare(cargo) level = prepped.delete(:level) || :info = "Notification: #{topic.inspect}." += " Reason: #{prepped.delete(:reason)}." if prepped[:reason] += " Cargo: #{prepped.inspect}" client.send(level, ) end |