yaml_enumeration 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/yaml_enumeration/enumeration.rb +15 -0
- data/lib/yaml_enumeration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7af81ba9c87a0967dd073af1af9efc89281f328f47e44c5d4677d7ae0074fdfa
|
4
|
+
data.tar.gz: e53b25152bbdda6c3b4b1acea36d123abae2be84e53e3031f42d1a55aae8f6a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e909ed89c6c32d3b6d60219ab5c81de2ae551fe0d4282c631a15f29a12fc4237f7b5be1620c839a25efa2918e8268050ac7fbcb1af4816839c3d1b7596e65ede
|
7
|
+
data.tar.gz: '096504aa3169d54cd443e9e29a018cb1bcf8b2f43dc15fe3dca81b103ff17cd4bf4c0c65314c211e920d429c28fd3ee1ea4e2669fabd902128c740227e638ec4'
|
data/CHANGELOG.md
CHANGED
@@ -78,6 +78,21 @@ module YamlEnumeration
|
|
78
78
|
self.all_instances ||= values.keys.map {|id| new(id)}
|
79
79
|
end
|
80
80
|
|
81
|
+
def count
|
82
|
+
return 0 unless values
|
83
|
+
all.size
|
84
|
+
end
|
85
|
+
|
86
|
+
def first
|
87
|
+
return nil unless values
|
88
|
+
all.first
|
89
|
+
end
|
90
|
+
|
91
|
+
def last
|
92
|
+
return nil unless values
|
93
|
+
all.last
|
94
|
+
end
|
95
|
+
|
81
96
|
def find(id)
|
82
97
|
case id
|
83
98
|
when Integer
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml_enumeration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thorsten Boettger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|