Class: ActiveSupport::Notifications::Fanout::Subscribers::Evented
- Defined in:
- lib/active_support/notifications/fanout.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #finish(name, id, payload) ⇒ Object
-
#initialize(pattern, delegate) ⇒ Evented
constructor
A new instance of Evented.
- #matches?(name) ⇒ Boolean
- #publish(name, *args) ⇒ Object
- #start(name, id, payload) ⇒ Object
- #subscribed_to?(name) ⇒ Boolean
Constructor Details
#initialize(pattern, delegate) ⇒ Evented
Returns a new instance of Evented.
85 86 87 88 89 |
# File 'lib/active_support/notifications/fanout.rb', line 85 def initialize(pattern, delegate) @pattern = pattern @delegate = delegate @can_publish = delegate.respond_to?(:publish) end |
Instance Method Details
#finish(name, id, payload) ⇒ Object
101 102 103 |
# File 'lib/active_support/notifications/fanout.rb', line 101 def finish(name, id, payload) @delegate.finish name, id, payload end |
#matches?(name) ⇒ Boolean
109 110 111 |
# File 'lib/active_support/notifications/fanout.rb', line 109 def matches?(name) @pattern && @pattern === name end |
#publish(name, *args) ⇒ Object
91 92 93 94 95 |
# File 'lib/active_support/notifications/fanout.rb', line 91 def publish(name, *args) if @can_publish @delegate.publish name, *args end end |
#start(name, id, payload) ⇒ Object
97 98 99 |
# File 'lib/active_support/notifications/fanout.rb', line 97 def start(name, id, payload) @delegate.start name, id, payload end |
#subscribed_to?(name) ⇒ Boolean
105 106 107 |
# File 'lib/active_support/notifications/fanout.rb', line 105 def subscribed_to?(name) @pattern === name end |