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:
parent
3870366092
commit
2cbef6996c
2 changed files with 2 additions and 8 deletions
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue