meta_enum 2.0.0 → 2.0.1
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/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/meta_enum/type.rb +6 -6
- data/lib/meta_enum/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: c864943910fad7b9ca83fbcfa8a8e514c5a9675e669e3f45ec5bc32e924d85c3
|
4
|
+
data.tar.gz: 64be15e7024853f90efb66fff368d3afb8b0093957ee9d010dbc31bd5ec7bc0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b350f51a27a0f119d2258a67de7fe29baf2f7a23fc64c0c4c43101e95cfcb27e21f7e3a49751d3365630f76dccd7379548705c573b826486f24baca2ce7a5448
|
7
|
+
data.tar.gz: 4ab4a6437a9490ba25bbaf9c607c500c4b935278f2991c41836a26a7d4fea0c5193b502bed7837a0a1f7656469b26c6a82594230b9483c7a1f26b7f70ca8e894
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/meta_enum/type.rb
CHANGED
@@ -59,14 +59,14 @@ module MetaEnum
|
|
59
59
|
# [] is a "do what I mean" operator. It returns the Element from this type depending on the key.
|
60
60
|
#
|
61
61
|
# When key is a symbol, it is considered the name of the Element to return.
|
62
|
-
# Since symbols are used from
|
62
|
+
# Since symbols are used from code, it is considered an error if the key is
|
63
63
|
# not found and it raises an exception.
|
64
64
|
#
|
65
|
-
# When key can be converted to an integer by
|
66
|
-
# considered the
|
65
|
+
# When key can be converted to an integer by value_normalizer, then it is
|
66
|
+
# considered the value of the Element to return. Retrieving by value is
|
67
67
|
# presumed to converting from external data where a missing value should not
|
68
|
-
# be considered fatal. In this case it returns a MissingElement is with
|
69
|
-
# as the key. This allows a Type to only specify the values
|
68
|
+
# be considered fatal. In this case it returns a MissingElement is with value
|
69
|
+
# as the key. This allows a Type to only specify the values it needs while
|
70
70
|
# passing through the others unmodified.
|
71
71
|
#
|
72
72
|
# Finally, when key is a MetaEnum::Element, it is simply returned (unless it
|
@@ -87,7 +87,7 @@ module MetaEnum
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def inspect
|
90
|
-
sprintf('#<%s: {%s}>', self.class, elements.to_a.map { |v| "#{v.name}: #{v.
|
90
|
+
sprintf('#<%s: {%s}>', self.class, elements.to_a.map { |v| "#{v.name}: #{v.value}"}.join(", "))
|
91
91
|
end
|
92
92
|
|
93
93
|
def size
|
data/lib/meta_enum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Christensen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|