Class: RockQueue::Notifiers

Inherits:
Object
  • Object
show all
Includes:
Observable
Defined in:
lib/rock-queue/notifiers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instanceObject

Return the instance of notifiers registry.



8
9
10
# File 'lib/rock-queue/notifiers.rb', line 8

def self.instance
  @__instance__ ||= new
end

Instance Method Details

#notify(message) ⇒ Object

Notifies all the observers



18
19
20
21
# File 'lib/rock-queue/notifiers.rb', line 18

def notify(message)
  changed
  notify_observers message
end

#register(instance) ⇒ Object

Registers the observer. You have to pass the instance of your notifier.



13
14
15
# File 'lib/rock-queue/notifiers.rb', line 13

def register(instance)
  add_observer instance
end