Class: RockQueue::Notifiers
- Inherits:
-
Object
- Object
- RockQueue::Notifiers
- Includes:
- Observable
- Defined in:
- lib/rock-queue/notifiers.rb
Class Method Summary collapse
-
.instance ⇒ Object
Return the instance of notifiers registry.
Instance Method Summary collapse
-
#notify(message) ⇒ Object
Notifies all the observers.
-
#register(instance) ⇒ Object
Registers the observer.
Class Method Details
.instance ⇒ Object
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() changed notify_observers 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 |