Class: Vayacondios::Notifier
- Inherits:
-
Vayacondios
- Object
- Vayacondios
- Vayacondios::Notifier
- Defined in:
- lib/vayacondios/client/notifier.rb
Direct Known Subclasses
CubeNotifier, HttpNotifier, LogNotifier, NullNotifier, ZabbixNotifier
Constant Summary
Constants inherited from Vayacondios
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
Methods inherited from Vayacondios
default_notifier, force_legacy_mode, legacy_switch
Methods included from Notifications
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/vayacondios/client/notifier.rb', line 6 def client @client end |
Instance Method Details
#notify(topic, cargo = {}) ⇒ Object
18 19 20 |
# File 'lib/vayacondios/client/notifier.rb', line 18 def notify(topic, cargo = {}) NoMethodError.unimplemented_method(self) end |
#prepare(obj) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/vayacondios/client/notifier.rb', line 8 def prepare(obj) case when obj.respond_to?(:to_inspectable) then obj.to_inspectable when obj.respond_to?(:to_wire) then obj.to_wire when obj.respond_to?(:to_hash) then obj.to_hash else raise ArgumentError.new("Cannot notify '#{obj.inspect}' -- require a hash-like object.") end end |