Class: ValidationRage::BaseNotifier
- Inherits:
-
Object
- Object
- ValidationRage::BaseNotifier
- Defined in:
- lib/validation_rage/base_notifier.rb
Direct Known Subclasses
FnordMetricNotifier, LogNotifier, UdpNotifier, ValidationRageNotifier
Defined Under Namespace
Classes: NotImplementedError
Instance Method Summary collapse
- #call(event_name, payload) ⇒ Object
- #data_present?(payload) ⇒ Boolean
-
#initialize(args = {}) ⇒ BaseNotifier
constructor
A new instance of BaseNotifier.
- #subscribe! ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ BaseNotifier
Returns a new instance of BaseNotifier.
5 6 |
# File 'lib/validation_rage/base_notifier.rb', line 5 def initialize(args={}) end |
Instance Method Details
#call(event_name, payload) ⇒ Object
7 8 9 |
# File 'lib/validation_rage/base_notifier.rb', line 7 def call(event_name, payload) raise NotImplementedError.new("your notifer must implement a call(event_name, payload) method") end |
#data_present?(payload) ⇒ Boolean
14 15 16 |
# File 'lib/validation_rage/base_notifier.rb', line 14 def data_present?(payload) payload.values.first && !payload.values.first.empty? end |
#subscribe! ⇒ Object
10 11 12 |
# File 'lib/validation_rage/base_notifier.rb', line 10 def subscribe! ActiveSupport::Notifications.subscribe(/validation_rage:.*/, self) end |