evt-collection 2.4.1.0 → 2.4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/collection/array.rb +9 -0
- data/lib/collection/collection.rb +2 -14
- data/lib/collection/generic.rb +10 -0
- data/lib/collection/set.rb +9 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acdf3ddd8cf03e33f61d6163eaf6a7c0ae963c783eeca9ed1f38d64f4e1acfb3
|
4
|
+
data.tar.gz: 172a238259d0896be26f26ecfbdc1a0def703f7004204a6c292fb844c3181048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8697c8f22452bc0e1a0836cc8e5b34c24e3a00f405a2295be63eceda8b7104488900c1da74884d2d6f9f5c396ceec88f98699bc87f0715dc205a493e088c6d20
|
7
|
+
data.tar.gz: 145a3c73e2b3fcdd1496c4a3aba907103aa5172fee7b1b1e4c1295844a5372287c8bfbb49ba88f3e86c1019bf1fe2bae3ca451198a0fa8baa201c3cbdfd04a3a
|
data/lib/collection/array.rb
CHANGED
@@ -46,13 +46,7 @@ module Collection
|
|
46
46
|
|
47
47
|
type_parameter = items[0].class
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
items.each do |member|
|
52
|
-
set.add(member)
|
53
|
-
end
|
54
|
-
|
55
|
-
set
|
49
|
+
Set[type_parameter].build(items)
|
56
50
|
end
|
57
51
|
|
58
52
|
def self.Array(items)
|
@@ -62,12 +56,6 @@ module Collection
|
|
62
56
|
|
63
57
|
type_parameter = items[0].class
|
64
58
|
|
65
|
-
|
66
|
-
|
67
|
-
items.each do |member|
|
68
|
-
array.add(member)
|
69
|
-
end
|
70
|
-
|
71
|
-
array
|
59
|
+
Array[type_parameter].build(items)
|
72
60
|
end
|
73
61
|
end
|
data/lib/collection/generic.rb
CHANGED
@@ -16,6 +16,16 @@ module Collection
|
|
16
16
|
|
17
17
|
def define_class(type_parameter)
|
18
18
|
cls = Class.new(self) do
|
19
|
+
def self.build(items)
|
20
|
+
instance = new
|
21
|
+
|
22
|
+
items.each do |member|
|
23
|
+
instance.add(member)
|
24
|
+
end
|
25
|
+
|
26
|
+
instance
|
27
|
+
end
|
28
|
+
|
19
29
|
def initialize; end
|
20
30
|
|
21
31
|
define_method :type_parameter do
|
data/lib/collection/set.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-collection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test_bench
|
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0'
|
59
59
|
requirements: []
|
60
|
-
rubygems_version: 3.
|
60
|
+
rubygems_version: 3.3.3
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Type-checked set
|