Module: Shouter
- Defined in:
- lib/shouter.rb,
lib/shouter/store.rb,
lib/shouter/version.rb,
lib/shouter/listener.rb
Defined Under Namespace
Classes: Listener, ScopeMissingError, Store
Constant Summary
collapse
- NoInheritanceAllowedError =
Class.new(StandardError)
- VERSION =
"0.1.0"
Instance Method Summary
collapse
Instance Method Details
#clear ⇒ Object
Also known as:
clear_listeners
18
19
20
|
# File 'lib/shouter.rb', line 18
def clear
Shouter::Store.clear
end
|
#publish(scope, event, *args, &block) ⇒ Object
14
15
16
|
# File 'lib/shouter.rb', line 14
def publish(scope, event, *args, &block)
Shouter::Store.notify(scope, event, args, &block)
end
|
#subscribe(*objects, **options) ⇒ Object
6
7
8
|
# File 'lib/shouter.rb', line 6
def subscribe(*objects, **options)
Shouter::Store.register(objects, options)
end
|
#unsubscribe(*objects) ⇒ Object
10
11
12
|
# File 'lib/shouter.rb', line 10
def unsubscribe(*objects)
Shouter::Store.unregister(objects)
end
|