koine-event_manager 2.1 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/koine/event_manager/event_listener.rb +1 -4
- data/lib/koine/event_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfb4bada53604e54aa8118063adccfcc996e137c387ba967521a1af7c99828e1
|
4
|
+
data.tar.gz: b043883d06200820bba474a3191db5d4f6816c67be5f9f02a3a2c7c7852740bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b996259bb8fc3c71633fb6a314d0fe433825d4bfeedd6b444db9b2e8f59c4a9e27c5b521b951ca6b1b76071f603f28b3a2b5c48a6b93210ba0de4a985f2c22f
|
7
|
+
data.tar.gz: 3ad407c03c10a251c2dd2450095cc9714af03d194282075e98ba4bfae0610bb350004c057445142cbeeac78cfae305ff2f77d8a6d4f398b6b714f6b8ae6761a0
|
data/README.md
CHANGED
@@ -94,8 +94,8 @@ end
|
|
94
94
|
|
95
95
|
subscriber = MySubscriber.new
|
96
96
|
|
97
|
-
event_manager.subscribe(subscriber, to:
|
98
|
-
event_manager.unsubscribe(subscriber, from:
|
97
|
+
event_manager.subscribe(subscriber, to: UserSignedIn)
|
98
|
+
event_manager.unsubscribe(subscriber, from: UserSignedIn)
|
99
99
|
```
|
100
100
|
|
101
101
|
## Development
|
@@ -16,6 +16,7 @@ module Koine
|
|
16
16
|
def subscribe(subscriber, to:)
|
17
17
|
@subscribers[subscriber] ||= []
|
18
18
|
@subscribers[subscriber] << to
|
19
|
+
@subscribers[subscriber] = @subscribers[subscriber].flatten.map(&:to_s).uniq
|
19
20
|
end
|
20
21
|
|
21
22
|
def unsubscribe(subscriber, from:)
|
@@ -53,10 +54,6 @@ module Koine
|
|
53
54
|
listeners[event_type.to_s] << block
|
54
55
|
end
|
55
56
|
|
56
|
-
def key_for(object_or_class)
|
57
|
-
object_or_class.to_s
|
58
|
-
end
|
59
|
-
|
60
57
|
attr_reader :listeners
|
61
58
|
attr_reader :subscribers
|
62
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: koine-event_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Jacobus
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|