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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b9873a9d37bf4b855172f564e19e47a9605e944a0b843f304183d3b8426dbf2
4
- data.tar.gz: e0aec9f5c363c823fb726140a4bdc6398c47887967b3602e0665993606f84ee6
3
+ metadata.gz: acdf3ddd8cf03e33f61d6163eaf6a7c0ae963c783eeca9ed1f38d64f4e1acfb3
4
+ data.tar.gz: 172a238259d0896be26f26ecfbdc1a0def703f7004204a6c292fb844c3181048
5
5
  SHA512:
6
- metadata.gz: 3b524d393b8d526b4d38f60c1a2d11d48b9e136123289251eac790235c4d0b1eff2b1b17b5425618e544c89e53efa1d9212d237235a8de7b1479b007ef7270d3
7
- data.tar.gz: ed544b2dcefb07112a0879937ae1e399319a0b092ba1e0d7849506de00c3bcc4657bc6aca9c0d7a329b63ba6eee4e03de52f5078340c9cfee0e62f05d8480329
6
+ metadata.gz: 8697c8f22452bc0e1a0836cc8e5b34c24e3a00f405a2295be63eceda8b7104488900c1da74884d2d6f9f5c396ceec88f98699bc87f0715dc205a493e088c6d20
7
+ data.tar.gz: 145a3c73e2b3fcdd1496c4a3aba907103aa5172fee7b1b1e4c1295844a5372287c8bfbb49ba88f3e86c1019bf1fe2bae3ca451198a0fa8baa201c3cbdfd04a3a
@@ -5,5 +5,14 @@ module Collection
5
5
  def content
6
6
  @content ||= ::Array.new
7
7
  end
8
+
9
+ def last
10
+ content.last
11
+ end
12
+
13
+ def length
14
+ count
15
+ end
16
+ alias :size :length
8
17
  end
9
18
  end
@@ -46,13 +46,7 @@ module Collection
46
46
 
47
47
  type_parameter = items[0].class
48
48
 
49
- set = Set[type_parameter].new
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
- array = Array[type_parameter].new
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
@@ -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
@@ -5,5 +5,14 @@ module Collection
5
5
  def content
6
6
  @content ||= ::Set.new
7
7
  end
8
+
9
+ def last
10
+ content.to_a.last
11
+ end
12
+
13
+ def length
14
+ count
15
+ end
16
+ alias :size :length
8
17
  end
9
18
  end
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.1.0
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: 2021-03-15 00:00:00.000000000 Z
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.1.2
60
+ rubygems_version: 3.3.3
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: Type-checked set