Module: Shouter
- Defined in:
- lib/shouter.rb,
lib/shouter/hook.rb,
lib/shouter/guard.rb,
lib/shouter/mixin.rb,
lib/shouter/store.rb,
lib/shouter/builder.rb,
lib/shouter/version.rb,
lib/shouter/listeners/sync.rb,
lib/shouter/listeners/async.rb
Defined Under Namespace
Modules: Listeners, Mixin
Classes: Builder, Guard, Hook, ScopeMissingError, Store
Constant Summary
collapse
- NoInheritanceAllowedError =
Class.new(StandardError)
- VERSION =
"0.1.3"
Instance Method Summary
collapse
Instance Method Details
#clear ⇒ Object
Also known as:
clear_listeners
30
31
32
|
# File 'lib/shouter.rb', line 30
def clear
Shouter::Store.clear
end
|
#publish(scope, event, *args, &block) ⇒ Object
26
27
28
|
# File 'lib/shouter.rb', line 26
def publish(scope, event, *args, &block)
Shouter::Store.notify(scope, event, args, &block)
end
|
#subscribe(*objects, **options) ⇒ Object
18
19
20
|
# File 'lib/shouter.rb', line 18
def subscribe(*objects, **options)
Shouter::Store.register(objects, options)
end
|
#unsubscribe(*objects) ⇒ Object
22
23
24
|
# File 'lib/shouter.rb', line 22
def unsubscribe(*objects)
Shouter::Store.unregister(objects)
end
|