enumerate_it 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/enumerate_it/base.rb +4 -0
- data/lib/enumerate_it/class_methods.rb +1 -0
- data/lib/enumerate_it/version.rb +1 -1
- data/spec/enumerate_it_spec.rb +6 -0
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/lib/enumerate_it/base.rb
CHANGED
@@ -8,6 +8,7 @@ module EnumerateIt
|
|
8
8
|
set_validations attribute, options
|
9
9
|
create_enumeration_humanize_method options[:with], attribute
|
10
10
|
store_enumeration options[:with], attribute
|
11
|
+
|
11
12
|
if options[:create_helpers]
|
12
13
|
create_helper_methods options[:with], attribute, options[:create_helpers]
|
13
14
|
create_mutator_methods options[:with], attribute, options[:create_helpers]
|
data/lib/enumerate_it/version.rb
CHANGED
data/spec/enumerate_it_spec.rb
CHANGED
@@ -334,6 +334,12 @@ describe EnumerateIt::Base do
|
|
334
334
|
end
|
335
335
|
end
|
336
336
|
|
337
|
+
describe ".keys" do
|
338
|
+
it "returns a list with the keys used to define the enumeration" do
|
339
|
+
TestEnumeration.keys.should == [:value_1, :value_2, :value_3]
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
337
343
|
describe ".key_for" do
|
338
344
|
it "returns the key for the given value inside the enumeration" do
|
339
345
|
TestEnumeration.key_for(TestEnumeration::VALUE_1).should == :value_1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
segments:
|
126
126
|
- 0
|
127
|
-
hash:
|
127
|
+
hash: 709884351936478852
|
128
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
segments:
|
135
135
|
- 0
|
136
|
-
hash:
|
136
|
+
hash: 709884351936478852
|
137
137
|
requirements: []
|
138
138
|
rubyforge_project:
|
139
139
|
rubygems_version: 1.8.24
|