Class: ActiveSupport::Notifications::Fanout::Subscribers::Evented Private

Inherits:
Object
  • Object
show all
Defined in:
lib/skylight/vendor/active_support/notifications/fanout.rb,
lib/skylight/compat.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Handle early RCs of rails 4.0

Direct Known Subclasses

Timed

Instance Method Summary collapse

Constructor Details

#initialize(pattern, delegate) ⇒ Evented

Returns a new instance of Evented.



83
84
85
86
87
# File 'lib/skylight/vendor/active_support/notifications/fanout.rb', line 83

def initialize(pattern, delegate)
  @pattern = pattern
  @delegate = delegate
  @can_publish = delegate.respond_to?(:publish)
end

Instance Method Details

#finish(name, id, payload) ⇒ Object



99
100
101
# File 'lib/skylight/vendor/active_support/notifications/fanout.rb', line 99

def finish(name, id, payload)
  @delegate.finish name, id, payload
end

#matches?(subscriber_or_name) ⇒ Boolean

Returns:

  • (Boolean)


107
108
109
110
# File 'lib/skylight/vendor/active_support/notifications/fanout.rb', line 107

def matches?(subscriber_or_name)
  self === subscriber_or_name ||
    @pattern && @pattern === subscriber_or_name
end

#publish(name, *args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
# File 'lib/skylight/vendor/active_support/notifications/fanout.rb', line 89

def publish(name, *args)
  if @can_publish
    @delegate.publish name, *args
  end
end

#start(name, id, payload) ⇒ Object



95
96
97
# File 'lib/skylight/vendor/active_support/notifications/fanout.rb', line 95

def start(name, id, payload)
  @delegate.start name, id, payload
end

#subscribed_to?(name) ⇒ Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/skylight/vendor/active_support/notifications/fanout.rb', line 103

def subscribed_to?(name)
  @pattern === name.to_s
end