Commit b36ef05 1 parent ec330e6 commit b36ef05 Copy full SHA for b36ef05
File tree 4 files changed +11
-9
lines changed
4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 9
9
PATH
10
10
remote: .
11
11
specs:
12
- wash_out (0.7.1 )
12
+ wash_out (0.8.0 )
13
13
nori (>= 2.0.0 )
14
14
15
15
GEM
Original file line number Diff line number Diff line change @@ -133,7 +133,11 @@ def self.parse_def(definition)
133
133
raise RuntimeError , "[] should not be used in your params. Use nil if you want to mark empty set." if definition == [ ]
134
134
return [ ] if definition == nil
135
135
136
- if [ Array , Symbol , Class ] . include? ( definition . class )
136
+ if definition . is_a? ( Class ) && definition . ancestors . include? ( WashOut ::Type )
137
+ definition = definition . wash_out_param_map
138
+ end
139
+
140
+ if [ Array , Symbol ] . include? ( definition . class )
137
141
definition = { :value => definition }
138
142
end
139
143
Original file line number Diff line number Diff line change 1
1
module WashOut
2
- VERSION = "0.7.1 "
2
+ VERSION = "0.8.0 "
3
3
end
Original file line number Diff line number Diff line change @@ -19,9 +19,8 @@ class Abraka2 < WashOut::Type
19
19
map = WashOut ::Param . parse_def Abraka2
20
20
21
21
map . should be_a_kind_of ( Array )
22
- map [ 0 ] . name . should == 'value'
23
- map [ 0 ] . map [ 0 ] . name . should == 'foo'
24
- map [ 0 ] . map [ 0 ] . map [ 0 ] . name . should == 'test'
22
+ map [ 0 ] . name . should == 'foo'
23
+ map [ 0 ] . map [ 0 ] . name . should == 'test'
25
24
end
26
25
27
26
it "respects camelization setting" do
@@ -30,9 +29,8 @@ class Abraka2 < WashOut::Type
30
29
map = WashOut ::Param . parse_def Abraka2
31
30
32
31
map . should be_a_kind_of ( Array )
33
- map [ 0 ] . name . should == 'Value'
34
- map [ 0 ] . map [ 0 ] . name . should == 'Foo'
35
- map [ 0 ] . map [ 0 ] . map [ 0 ] . name . should == 'Test'
32
+ map [ 0 ] . name . should == 'Foo'
33
+ map [ 0 ] . map [ 0 ] . name . should == 'Test'
36
34
end
37
35
end
38
36
You can’t perform that action at this time.
0 commit comments