valuable 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/valuable/utils.rb +2 -0
- data/test/parse_with_test.rb +5 -0
- data/valuable.version +1 -1
- metadata +4 -4
data/.gitignore
CHANGED
data/lib/valuable/utils.rb
CHANGED
data/test/parse_with_test.rb
CHANGED
@@ -18,6 +18,7 @@ class RailsApp < Valuable
|
|
18
18
|
has_value :tech_lead, :klass => Person, :parse_with => :load
|
19
19
|
has_collection :devs, :klass => Person, :parse_with => :load
|
20
20
|
has_value :name, :parse_with => lambda{|x| x == 'IA' ? 'Information Architecture' : x}
|
21
|
+
has_value :overlord, :klass => Person, :parse_with => lambda{|name| Person.load(name) }
|
21
22
|
end
|
22
23
|
|
23
24
|
class ParseWithTest < Test::Unit::TestCase
|
@@ -44,4 +45,8 @@ class ParseWithTest < Test::Unit::TestCase
|
|
44
45
|
animal.has_value :invalid, :klass => :integer, :parse_with => :method
|
45
46
|
end
|
46
47
|
end
|
48
|
+
|
49
|
+
def test_that_lambdas_can_be_combined_with_a_class
|
50
|
+
assert_equal 'vader', RailsApp.new(:overlord => 'darth vader').overlord.last_name
|
51
|
+
end
|
47
52
|
end
|
data/valuable.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.5
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valuable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 49
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 5
|
10
|
+
version: 0.9.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Johnathon Wright
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-05-08 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|