contracts 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. data/lib/contracts.rb +4 -2
  2. metadata +3 -3
data/lib/contracts.rb CHANGED
@@ -119,7 +119,8 @@ Args: #{args.inspect}
119
119
  Contracts: #{@contracts.map { |t| t.is_a?(Class) ? t.name : t.class.name }.join(", ")}}
120
120
  end
121
121
  end
122
- Contract.validate_all(_args, @contracts[0, @contracts.size - 1], @klass, @method)
122
+ res = Contract.validate_all(_args, @contracts[0, @contracts.size - 1], @klass, @method)
123
+ return if res == false
123
124
 
124
125
  result = @method.bind(this).call(*args, &blk)
125
126
 
@@ -170,7 +171,8 @@ Contracts: #{@contracts.map { |t| t.is_a?(Class) ? t.name : t.class.name }.join(
170
171
  end
171
172
 
172
173
  args.zip(contracts).each do |arg, contract|
173
- validate(arg, contract, klass, method, contracts)
174
+ result = validate(arg, contract, klass, method, contracts)
175
+ return result if result == false
174
176
  end
175
177
  end
176
178
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contracts
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aditya Bhargava