enumerate_it 1.2.1 → 1.2.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 +8 -8
- data/Gemfile.lock +1 -1
- data/README.markdown +7 -1
- data/lib/enumerate_it/base.rb +4 -0
- data/lib/enumerate_it/version.rb +1 -1
- data/spec/enumerate_it/base_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Mjk3OWI5YmVhYjVkZWUxN2ZhNzVlMWVkYjRhZDhlNDQwZWY2NjQ4ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2QzNTcwYTQzOTU2ZmQ1MzBjMzc2YWVlMDkwMmE5NjJlNDNlYjRlOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjQ2OWVhNDVhZjg0MjJmZGRkMzYxODU5MWY1ZTFlYTc3ZDk0ZGFiNjBkYjA5
|
10
|
+
M2E1YTYwOGZjMjU1ZjQyNjcyMTNmODkxMDdhNzEyM2IzYTk3OTg2YmQzODVk
|
11
|
+
YTFmNzA5ZTU0NTYyNmJjZTIwYzYzZTZhZTNjOTk1MzgyNDY3NWQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzIzZjY4YTgwM2FiNGI0MTQxNmZmY2JhYWUyYjk3YzJhYTlkOTY2ZmE1ZjJm
|
14
|
+
ODljNmQwNjVkNTczMjY5NzAzOGI5MjU4ODE4OTY3Yzc1MmQ5OTBjODUyMzI2
|
15
|
+
Y2RjMmNiOTZjY2I2ZGM4NDgzNzllNzY0MWRhNDUzMDFlZmI4NWU=
|
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -127,6 +127,12 @@ This will create some nice stuff:
|
|
127
127
|
RelationshipStatus.each_translation { |translation| ... }
|
128
128
|
```
|
129
129
|
|
130
|
+
* You can also retrieve all the translations of the enumeration:
|
131
|
+
|
132
|
+
``` ruby
|
133
|
+
RelationshipStatus.translations
|
134
|
+
```
|
135
|
+
|
130
136
|
* You can ask for the enumeration's length:
|
131
137
|
|
132
138
|
``` ruby
|
@@ -398,7 +404,7 @@ only to those derived from ActiveRecord::Base.
|
|
398
404
|
|
399
405
|
## I18n
|
400
406
|
|
401
|
-
I18n lookup is provided on both
|
407
|
+
I18n lookup is provided on both `_humanized` and `Enumeration#to_a` methods,
|
402
408
|
given the hash key is a Symbol. The I18n strings are located on
|
403
409
|
enumerations.'enumeration_name'.'key' :
|
404
410
|
|
data/lib/enumerate_it/base.rb
CHANGED
data/lib/enumerate_it/version.rb
CHANGED
@@ -36,6 +36,12 @@ describe EnumerateIt::Base do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
describe ".translations" do
|
40
|
+
it "returns all translations" do
|
41
|
+
TestEnumeration.translations.should == ["Hey, I am 1!", "Hey, I am 2!", "Hey, I am 3!"]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
39
45
|
describe ".each_value" do
|
40
46
|
it "yields each enumeration's value" do
|
41
47
|
values = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cássio Marques
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|