def_enum_helper 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/def_enum_helper/version.rb +1 -1
- data/lib/def_enum_helper.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edd5b5abefcbb09535b94af42a8b7019c127c2f2
|
4
|
+
data.tar.gz: 01b90f02d87a761fa00ae5f674c3f6e3967b49e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e5068f60b09966bba27aa60c6d362368fa26065a8601676a66d021be4a6d16db8aee817166bb4851dcb0d93e7a82117c46def552f6e2c05a87d9342de6147b8
|
7
|
+
data.tar.gz: 61904a4a0b3d0bf9017509cfe1ec10f075df6f3590b0dbd69e8a7fff9e4311d0b7ab9009cbad03f2d3ba6338f29000106f335c93232d5959886b211da3550a1b
|
data/lib/def_enum_helper.rb
CHANGED
@@ -82,7 +82,7 @@ end
|
|
82
82
|
def define_subscript_method(m, enum_index_hash, enum_display_hash)
|
83
83
|
divisor = enum_index_hash.count
|
84
84
|
|
85
|
-
m.define_singleton_method(:from_number) { |n| (n - DEFAULT_ENUM_BASE_INDEX) % divisor + DEFAULT_ENUM_BASE_INDEX }
|
85
|
+
# m.define_singleton_method(:from_number) { |n| (n - DEFAULT_ENUM_BASE_INDEX) % divisor + DEFAULT_ENUM_BASE_INDEX }
|
86
86
|
m.define_singleton_method(:[]) do |k|
|
87
87
|
case k
|
88
88
|
when String
|
@@ -90,7 +90,7 @@ def define_subscript_method(m, enum_index_hash, enum_display_hash)
|
|
90
90
|
when Symbol
|
91
91
|
enum_index_hash[const_get(k)]
|
92
92
|
else
|
93
|
-
enum_index_hash[
|
93
|
+
enum_index_hash[k]
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: def_enum_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|