reasonable-value 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e5918ca928d7840741f459d98f1c35f239dc9d8
4
- data.tar.gz: c0acde6480ae1bdc01b610df5c1a52bdd5f9a754
3
+ metadata.gz: c1ab93b62305d6676a78a210a30ce9e9dd2735b2
4
+ data.tar.gz: 81d160d2827e462b6f55c5fe5345ce8337b86f81
5
5
  SHA512:
6
- metadata.gz: 99a2576820e6214f95dfff2bb98e38889b170f055885f512a5bfaaac8c4fb0803356e431d17e8e5b8bcb73b140b19741591a088a862c6e2120b67f747397a56e
7
- data.tar.gz: 42964154cac368d69d5218992f07ab12a79011ab94f53b8512fdf43dfe4e0a351a7360b436e2be994499b578e837e6faa36c8b2aec3fe8060211106c94822239
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 corcible (meaning that passing a Float
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
@@ -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
@@ -1,7 +1,7 @@
1
1
  module Reasonable
2
2
  class Value
3
3
 
4
- VERSION = '0.2.4'.freeze
4
+ VERSION = '0.2.5'.freeze
5
5
 
6
6
  end
7
7
  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
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-04-04 00:00:00.000000000 Z
11
+ date: 2017-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport