code-ruby 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22e265eb7980e078c895b92b71d1e5b0e3e3a35cb833537bdc0f1614ce2ac76b
4
- data.tar.gz: 9d2f374bb8a627bc3b0fbb2325630a692fa01bef52a9a81750db643454163f60
3
+ metadata.gz: 51e07a3736fa390271534aa21eb24fb5bdd5a149a06ae2b3aa3865fe3ed411d3
4
+ data.tar.gz: 5b2be326d1fb68f97a6f4729aab8e639241e45496afcff0f503db104b505e111
5
5
  SHA512:
6
- metadata.gz: b43ac0ea5ad94cdf569518df455be616c0a1a21ba90ec548c278080eaf36b8466707960ff07bc90739a3ebb2cd9e31e481da4646eebd47ef9cd4e5d543b7c7a2
7
- data.tar.gz: 33c41f911e6a9043f79a2c89a58e373fd200715f35bfcd8c0bea5554a10c2eca2c8b4fd145f4676c33a7723e5d5fb15179a6af568b079e43170fa0ce09eced15
6
+ metadata.gz: 0024632b4b4f724c1c2726cf25896cb7a09c231d689bf22359c5cf2206dbddb1c9a298ee0e9b4127c7da7a3eb860952b618477def968446048639b6e9ee36ff0
7
+ data.tar.gz: 442576080a62326683fec644a9c6b5a62d0163a6d6488c7e9b85c85fd60d0b30a45fc1be99595f0f065e8dd8899bfeb853593a5e1b36fa838277f790ecff76d7
@@ -14,9 +14,11 @@ class Code
14
14
 
15
15
  argument = argument.raw
16
16
  (argument.keys + hash.keys).uniq.all? do |key|
17
- next false unless hash[key] && argument[key]
18
-
19
- valid_for?(expected: hash[key], actual: argument[key])
17
+ if hash[key]
18
+ valid_for?(expected: hash[key], actual: argument[key] || Object::Nothing.new)
19
+ else
20
+ false
21
+ end
20
22
  end
21
23
  end
22
24
 
@@ -10,7 +10,9 @@ class Code
10
10
  end
11
11
 
12
12
  def valid?(argument)
13
- !argument || valid_for?(expected: clazz, actual: argument)
13
+ !argument ||
14
+ argument.is_a?(Object::Nothing) ||
15
+ valid_for?(expected: clazz, actual: argument)
14
16
  end
15
17
 
16
18
  def min_arguments
data/lib/code/version.rb CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require_relative "../code"
4
4
 
5
- Code::Version = Gem::Version.new("0.6.5")
5
+ Code::Version = Gem::Version.new("0.6.6")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié