reasonable-value 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/reasonable/value.rb +2 -0
- data/lib/reasonable/value/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1ab93b62305d6676a78a210a30ce9e9dd2735b2
|
4
|
+
data.tar.gz: 81d160d2827e462b6f55c5fe5345ce8337b86f81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7f01564ec99f4af3af13a612cb1abc5b9494053e70ed6d55c3cf49807c2af3086ab3c50edfbfb1d7df79757220f7a8f4d12eb04fd1c1f71ac452697d6227869
|
7
|
+
data.tar.gz: 188ac754b763c71342c2ef2bd5014efc9777d1a3b7555d27a38daf2191791af5e7114ecb870cfcc081f0d7e3092383fbc2fe55480e7232b466355e345487e8c4
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Or install it yourself as:
|
|
32
32
|
|
33
33
|
## Usage
|
34
34
|
|
35
|
-
By default attributes are mandatory, but
|
35
|
+
By default attributes are mandatory, but coercible (meaning that passing a Float
|
36
36
|
when an Integer is expected will **not** raise an error:
|
37
37
|
``` ruby
|
38
38
|
class StandardValue < Reasonable::Value
|
data/lib/reasonable/value.rb
CHANGED
@@ -17,6 +17,8 @@ module Reasonable
|
|
17
17
|
self.class.send(:config).each do |name, config|
|
18
18
|
next if attributes[name].nil? && config[:options][:optional]
|
19
19
|
|
20
|
+
type_error(name, config[:type], NilClass) if attributes[name].nil?
|
21
|
+
|
20
22
|
@attributes[name] = coerce(attributes, name, config)
|
21
23
|
end
|
22
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reasonable-value
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Larrieu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|