emittance 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/emittance/dispatcher/registration_collection_proxy.rb +28 -1
- data/lib/emittance/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb073480e93c98fa14f649645d6c9c50d026288
|
4
|
+
data.tar.gz: 2189f09a861ba518cc4887b4ab888ee9eec2abbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 181e8a6a597a8684be6dab5d03e4651b42969b6fd168c121307309e8e0334e9eecd2817db78855e9efc13bb0a3e64f2e8e58043e5ce17d15d251eb89ec2dd822
|
7
|
+
data.tar.gz: 1ffd3a6302f02a11ea975b6d1d19ced771b967ae20905969ea355d62b9cc5bd161ef503e6a66387e4d087b1d5be49c3865a136c4229b7092b0696d03a320d6ba
|
data/Gemfile.lock
CHANGED
@@ -17,7 +17,6 @@ module Emittance
|
|
17
17
|
# @param blk block passed to +Array#each+
|
18
18
|
# @return [RegistrationCollectionProxy] self
|
19
19
|
def each(*args, &blk)
|
20
|
-
arrays = mappings.values.map(&:to_a)
|
21
20
|
arrays.flatten.each(*args, &blk)
|
22
21
|
self
|
23
22
|
end
|
@@ -27,6 +26,30 @@ module Emittance
|
|
27
26
|
mappings.values.all?(&:empty?)
|
28
27
|
end
|
29
28
|
|
29
|
+
# @return [Integer] the number of registrations that exist in the collection
|
30
|
+
def length
|
31
|
+
arrays.flatten.length
|
32
|
+
end
|
33
|
+
|
34
|
+
alias size length
|
35
|
+
alias count length
|
36
|
+
|
37
|
+
# @param idx [Integer] the index you wish to find
|
38
|
+
# @return the registration indexed at the specified index
|
39
|
+
def [](idx)
|
40
|
+
arrays.flatten[idx]
|
41
|
+
end
|
42
|
+
|
43
|
+
# @return the registration at the first index
|
44
|
+
def first
|
45
|
+
self[0]
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return the registration at the last index
|
49
|
+
def last
|
50
|
+
self[-1]
|
51
|
+
end
|
52
|
+
|
30
53
|
# @return [RegistrationCollectionProxy] self
|
31
54
|
def <<(item)
|
32
55
|
mappings[lookup_term] << item
|
@@ -42,6 +65,10 @@ module Emittance
|
|
42
65
|
private
|
43
66
|
|
44
67
|
attr_reader :lookup_term, :mappings
|
68
|
+
|
69
|
+
def arrays
|
70
|
+
mappings.values.map(&:to_a)
|
71
|
+
end
|
45
72
|
end
|
46
73
|
end
|
47
74
|
end
|
data/lib/emittance/version.rb
CHANGED