event_bus 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/event_bus.rb +0 -10
- data/lib/event_bus/registrations.rb +0 -8
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/lib/event_bus.rb
CHANGED
@@ -78,16 +78,6 @@ class EventBus
|
|
78
78
|
self
|
79
79
|
end
|
80
80
|
|
81
|
-
#
|
82
|
-
# (experimental)
|
83
|
-
#
|
84
|
-
def register(listener)
|
85
|
-
listener.events_map.each do |pattern, method_name|
|
86
|
-
registrations.add(pattern, listener, method_name)
|
87
|
-
end
|
88
|
-
self
|
89
|
-
end
|
90
|
-
|
91
81
|
private
|
92
82
|
|
93
83
|
def subscribe_pattern(pattern, listener, method_name, &blk)
|
@@ -22,14 +22,6 @@ class EventBus
|
|
22
22
|
@listeners = []
|
23
23
|
end
|
24
24
|
|
25
|
-
def add(pattern, listener, method_name, &blk)
|
26
|
-
if listener
|
27
|
-
add_method(pattern, listener, method_name)
|
28
|
-
else
|
29
|
-
add_block(pattern, blk)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
25
|
def add_method(pattern, listener, method_name)
|
34
26
|
@listeners << Registration.new(pattern, listener, method_name)
|
35
27
|
end
|