enum_help 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/enum_help/i18n.rb +5 -1
- data/lib/enum_help/version.rb +1 -1
- 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: 8f384a872b8a965d2c3c1e3213d957f56f2f81ce
|
4
|
+
data.tar.gz: 47733a81ef522b6df322c9a8be6b78097c85bb67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc36a1846a9e2718181175e430c2ffee181422d40c84d25b23526cd01d969f41ff1c05bb78c0dd1f2ef06bb30e8e54cacabb851f66d036af7b847abe1bc029ae
|
7
|
+
data.tar.gz: 1e4136f604af3825a3f2473865a0b7efb52b62a45d2acc577a5e9de6f5bc1a1f9f567e66d0b3f0db8579f1bcce7386516ceb95883375ea720facef144dd5d249
|
data/lib/enum_help/i18n.rb
CHANGED
@@ -10,7 +10,11 @@ module EnumHelp
|
|
10
10
|
i18n_method_name = "#{name}_i18n".to_sym
|
11
11
|
define_method(i18n_method_name) do
|
12
12
|
enum_value = self.send(name)
|
13
|
-
|
13
|
+
if enum_value
|
14
|
+
::I18n.t("enums.#{klass.to_s.underscore}.#{name}.#{enum_value}", default: enum_value)
|
15
|
+
else
|
16
|
+
nil
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
data/lib/enum_help/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enum_help
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lester Zhao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|