Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing Binding class

  • Loading branch information...
commit 4226c93779dae53c6921f8ce93d6af000a24e2d1 1 parent 9c80f5b
@tenderlove tenderlove authored
Showing with 4 additions and 14 deletions.
  1. +4 −14 activesupport/lib/active_support/notifications/fanout.rb
View
18 activesupport/lib/active_support/notifications/fanout.rb
@@ -6,13 +6,15 @@ class Fanout
def initialize
@subscribers = []
@listeners_for = {}
+ @pattern = nil
end
def bind(pattern)
- Binding.new(self, pattern)
+ @pattern = pattern
+ self
end
- def subscribe(pattern = nil, &block)
+ def subscribe(pattern = @pattern, &block)
@listeners_for.clear
@subscribers << Subscriber.new(pattern, &block)
@subscribers.last
@@ -35,18 +37,6 @@ def publish(name, *args)
def wait
end
- # Used for internal implementation only.
- class Binding #:nodoc:
- def initialize(queue, pattern)
- @queue = queue
- @pattern = pattern
- end
-
- def subscribe(&block)
- @queue.subscribe(@pattern, &block)
- end
- end
-
class Subscriber #:nodoc:
def initialize(pattern, &block)
@pattern = pattern
Please sign in to comment.
Something went wrong with that request. Please try again.