1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

bind method is not needed, so goodbye! <3 <3 <3

This commit is contained in:
Aaron Patterson 2010-07-18 15:37:23 -07:00
parent 3870366092
commit 2cbef6996c
2 changed files with 2 additions and 8 deletions

View file

@ -65,7 +65,7 @@ module ActiveSupport
end end
def subscribe(pattern = nil, &block) def subscribe(pattern = nil, &block)
@queue.bind(pattern).subscribe(&block) @queue.subscribe(pattern, &block)
end end
def unsubscribe(subscriber) def unsubscribe(subscriber)

View file

@ -6,15 +6,9 @@ module ActiveSupport
def initialize def initialize
@subscribers = [] @subscribers = []
@listeners_for = {} @listeners_for = {}
@pattern = nil
end end
def bind(pattern) def subscribe(pattern = nil, &block)
@pattern = pattern
self
end
def subscribe(pattern = @pattern, &block)
@listeners_for.clear @listeners_for.clear
@subscribers << Subscriber.new(pattern, &block) @subscribers << Subscriber.new(pattern, &block)
@subscribers.last @subscribers.last