evt-collection 1.0.0.1 → 1.0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/collection/set.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94c1a5732a69bbfbbfd19f8fb2500bae6063c516ea6198502c7ac93d71b30154
|
4
|
+
data.tar.gz: 16aebc9429c4616f9a0d75784e6c6fcae71f27eab784b9de911c94719e268b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5028258f11acfa0bd8e10b6ebabcc7af629d3320116adf6c0fda793fb6e7f2c4210263f26ea22a17074ee0cfa1cb6112b731431bd4302acff3cacb66b7853fd
|
7
|
+
data.tar.gz: 62927d8b8a68f96f12420744d6ee09350a43a612b1793851bdc09cc24c4acf60a0a7e4d4621eda02a7f99b81085a69d12e1178115e7a3d7e3b83585ebd1b4cf1
|
data/lib/collection/set.rb
CHANGED
@@ -52,7 +52,7 @@ module Collection
|
|
52
52
|
|
53
53
|
def add(val)
|
54
54
|
raise ArgumentError, "#{val.inspect} must be a #{type_parameter.name}" unless val.is_a? type_parameter
|
55
|
-
|
55
|
+
content.add(val)
|
56
56
|
end
|
57
57
|
alias :<< :add
|
58
58
|
|
@@ -65,33 +65,33 @@ module Collection
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def entries(&predicate)
|
68
|
-
|
68
|
+
content.select(&predicate)
|
69
69
|
end
|
70
70
|
|
71
71
|
def entry(&predicate)
|
72
|
-
|
72
|
+
content.find(&predicate)
|
73
73
|
end
|
74
74
|
|
75
75
|
def each(&action)
|
76
|
-
|
76
|
+
content.each(&action)
|
77
77
|
end
|
78
78
|
|
79
79
|
def entries?
|
80
|
-
!
|
80
|
+
!content.empty?
|
81
81
|
end
|
82
82
|
|
83
83
|
def empty?
|
84
|
-
|
84
|
+
content.empty?
|
85
85
|
end
|
86
86
|
|
87
87
|
def length
|
88
|
-
|
88
|
+
content.length
|
89
89
|
end
|
90
90
|
alias :size :length
|
91
91
|
alias :count :length
|
92
92
|
|
93
|
-
|
94
|
-
@
|
93
|
+
def content
|
94
|
+
@content ||= ::Set.new
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|