data_contract 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 95fd1fd64251742ff7636bba6474cd91bdf5bec9
4
- data.tar.gz: 1180fa320ad2f4fc4e90bde008ad5f181690ce2d
3
+ metadata.gz: 21313bf05ccac5fd51cab90b564671c466fef3e8
4
+ data.tar.gz: e47156450c05cd0701743c566409f6b08d67a60a
5
5
  SHA512:
6
- metadata.gz: 9cf561c4afc12f8178b9eb731008d8db3d6068754ec821c515ec366f981728874b8ea639ef6e51011950835219c6c0e6c0dac4ea7c606bfddaf2a4567f64eab4
7
- data.tar.gz: 834cb5321baf48eecb599c01ed54d1cc94417e206a8c212d0f472cefbdb027aea7ce014c8f69f5118dab5366899ea3453c9a0109a5688045ae8c8668573774e3
6
+ metadata.gz: 55899798ce639684c28fd30c514de98801084dc42d7ec8ded6142351e7ff3facb54984d990bdc7ca9295714c72c88710929cd2a779fc8a8304128c71c63bf1de
7
+ data.tar.gz: 7a7f8e393b9f44c2da1edd7ad206fe7fe282a3e1b897c67a0ecb0f80a1669405e63f50d90e3709ca44a1e5841b9e70702d4fecc6b5ebf3a790df4fcfe3ed67ef
@@ -1,2 +1,3 @@
1
1
  require 'data_contract/data_contract'
2
+ require 'data_contract/incompatible_signature_error'
2
3
  require 'data_contract/implementation'
@@ -1,6 +1,7 @@
1
1
  class DataContract < Module
2
2
  module Implementation
3
3
  def scatter(target)
4
+ raise IncompatibleSignatureError, "#{self.class.name} does not have a shared contract with #{target.class.name}" if !shared_contract? target
4
5
  setters.each do |setter|
5
6
  getter = setter[0...-1]
6
7
  val = send getter
@@ -0,0 +1,4 @@
1
+ class DataContract < Module
2
+ class IncompatibleSignatureError < StandardError
3
+ end
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_contract
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Sans Collective
@@ -18,6 +18,7 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - lib/data_contract/data_contract.rb
20
20
  - lib/data_contract/implementation.rb
21
+ - lib/data_contract/incompatible_signature_error.rb
21
22
  - lib/data_contract.rb
22
23
  homepage: https://github.com/Sans/data-contract
23
24
  licenses: []