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