typero 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/lib/typero.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1c86d82e552055ef4caf2fcd72dcbfb040431d44f37dba36016ff93e4785ccf
|
4
|
+
data.tar.gz: d9e2dda55e722b7c7b2e6d54b87e363e7b1491c903007be100512cf22e0798f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff912277d4fe41e6d18637ee208f2f91d066be02e4ef2b3fba26ce69684b13dcd5a9a8a1078d09b7e241b8c6196dccacdda6d06f1a2e08bc310c2f52d5ce9e6d
|
7
|
+
data.tar.gz: 5aa99ee889b1524727f43a76bf5c2cfd8b8d8f85a634081607248680f81dc0b004781bc1dff936b0a17d2a17e31bbe46536e52a569a7fc3f4cd2ea2c55d80cc4
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
data/lib/typero.rb
CHANGED
@@ -91,11 +91,12 @@ class Typero
|
|
91
91
|
|
92
92
|
# used in dsl to define value
|
93
93
|
def set field, type=String, opts={}
|
94
|
-
klass = '::Typero::%sType' % type.to_s.gsub(/[^\w]/,'').classify
|
95
|
-
klass.constantize
|
96
|
-
|
97
94
|
opts = type.is_a?(Hash) ? type : opts.merge(type: type)
|
98
95
|
|
96
|
+
opts[:type] ||= :string
|
97
|
+
klass = 'Typero::%sType' % opts[:type].to_s.gsub(/[^\w]/,'').classify
|
98
|
+
klass.constantize
|
99
|
+
|
99
100
|
@rules[field] = parse_option opts
|
100
101
|
end
|
101
102
|
|