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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acdf3ddd8cf03e33f61d6163eaf6a7c0ae963c783eeca9ed1f38d64f4e1acfb3
4
- data.tar.gz: 172a238259d0896be26f26ecfbdc1a0def703f7004204a6c292fb844c3181048
3
+ metadata.gz: 699f42d6306d91f0390b798ca859f6d68ee1df6eb6641dc78dfef84f2db0006b
4
+ data.tar.gz: 3d3c3853ae0b9e7a96d537e6406f4e4c780c6e62e03813c420d657b111e8e62b
5
5
  SHA512:
6
- metadata.gz: 8697c8f22452bc0e1a0836cc8e5b34c24e3a00f405a2295be63eceda8b7104488900c1da74884d2d6f9f5c396ceec88f98699bc87f0715dc205a493e088c6d20
7
- data.tar.gz: 145a3c73e2b3fcdd1496c4a3aba907103aa5172fee7b1b1e4c1295844a5372287c8bfbb49ba88f3e86c1019bf1fe2bae3ca451198a0fa8baa201c3cbdfd04a3a
6
+ metadata.gz: '0697d5d3bdc8b40f263b68907d7b75ac7ceaf1f236bed99fb9c4b44424b8aafd51d8d2df695748676a62f7e281f9525b60f0cc18d19e4dc5a03f4615fed8c54e'
7
+ data.tar.gz: 9a959a04cc0421afaea92c179ac087411855438792906bfccd632fa5084908478abd6e075dfc2edffdbea3ddcaae9c510126f7771b264708c4aca391ca474095
@@ -11,6 +11,13 @@ module Collection
11
11
 
12
12
  class Member
13
13
  end
14
+
15
+ module Root
16
+ def self.example
17
+ root_class_name = "Class#{SecureRandom.hex(2).upcase}"
18
+ Object.const_set(root_class_name, Class.new)
19
+ end
20
+ end
14
21
  end
15
22
  end
16
23
  end
@@ -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.3.0
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: 2022-10-03 00:00:00.000000000 Z
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.3.3
60
+ rubygems_version: 3.4.6
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: Type-checked set