evt-collection 2.4.3.0 → 2.4.4.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/controls/member.rb +7 -0
- data/lib/collection/generic.rb +7 -3
- 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: 699f42d6306d91f0390b798ca859f6d68ee1df6eb6641dc78dfef84f2db0006b
|
4
|
+
data.tar.gz: 3d3c3853ae0b9e7a96d537e6406f4e4c780c6e62e03813c420d657b111e8e62b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0697d5d3bdc8b40f263b68907d7b75ac7ceaf1f236bed99fb9c4b44424b8aafd51d8d2df695748676a62f7e281f9525b60f0cc18d19e4dc5a03f4615fed8c54e'
|
7
|
+
data.tar.gz: 9a959a04cc0421afaea92c179ac087411855438792906bfccd632fa5084908478abd6e075dfc2edffdbea3ddcaae9c510126f7771b264708c4aca391ca474095
|
data/lib/collection/generic.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Collection
|
2
2
|
module Generic
|
3
|
-
def [](type_parameter)
|
3
|
+
def [](type_parameter, &implementation)
|
4
4
|
type_parameter_name = constant_name(type_parameter)
|
5
5
|
|
6
6
|
cls = nil
|
7
7
|
unless self.const_defined?(type_parameter_name, false)
|
8
|
-
cls = define_class(type_parameter)
|
8
|
+
cls = define_class(type_parameter, &implementation)
|
9
9
|
set_collection_constant(type_parameter, cls)
|
10
10
|
else
|
11
11
|
cls = const_get(type_parameter_name)
|
@@ -14,7 +14,7 @@ module Collection
|
|
14
14
|
cls
|
15
15
|
end
|
16
16
|
|
17
|
-
def define_class(type_parameter)
|
17
|
+
def define_class(type_parameter, &implementation)
|
18
18
|
cls = Class.new(self) do
|
19
19
|
def self.build(items)
|
20
20
|
instance = new
|
@@ -33,6 +33,10 @@ module Collection
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
if not implementation.nil?
|
37
|
+
cls.class_exec(&implementation)
|
38
|
+
end
|
39
|
+
|
36
40
|
set_collection_constant(type_parameter, cls)
|
37
41
|
|
38
42
|
cls
|
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.4.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: 2024-01-23 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.4.6
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Type-checked set
|