Class: Dionysus::Monitor
- Inherits:
-
Dry::Monitor::Notifications
- Object
- Dry::Monitor::Notifications
- Dionysus::Monitor
- Defined in:
- lib/dionysus/monitor.rb
Defined Under Namespace
Classes: UnknownEventError
Instance Method Summary collapse
- #events ⇒ Object
-
#initialize ⇒ Monitor
constructor
A new instance of Monitor.
- #subscribe(event) ⇒ Object
Constructor Details
#initialize ⇒ Monitor
Returns a new instance of Monitor.
19 20 21 22 |
# File 'lib/dionysus/monitor.rb', line 19 def initialize super(:dionysus) EVENTS.each { |event| register_event(event) } end |
Instance Method Details
#events ⇒ Object
30 31 32 |
# File 'lib/dionysus/monitor.rb', line 30 def events EVENTS end |
#subscribe(event) ⇒ Object
24 25 26 27 28 |
# File 'lib/dionysus/monitor.rb', line 24 def subscribe(event) return super if events.include?(event.to_s) raise UnknownEventError.new(events, event) end |