Class: Dionysus::Monitor

Inherits:
Dry::Monitor::Notifications
  • Object
show all
Defined in:
lib/dionysus/monitor.rb

Defined Under Namespace

Classes: UnknownEventError

Instance Method Summary collapse

Constructor Details

#initializeMonitor

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

#eventsObject



30
31
32
# File 'lib/dionysus/monitor.rb', line 30

def events
  EVENTS
end

#subscribe(event) ⇒ Object

Raises:



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