data_contract 0.0.4 → 0.0.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: e708facb4e75c251034eaf360f25718cca5962ba
4
- data.tar.gz: 92dfe406b28d3254d9048a9a15cbd20703697698
3
+ metadata.gz: f27e555f982ef09a4f72e805408545ed8cf43380
4
+ data.tar.gz: a0d62046920fe6f9b9d5d55ad359cf42443e780a
5
5
  SHA512:
6
- metadata.gz: 418142349c27fcdd96c41a6e88f86fc2a3b95d253a079f489d1b3daa677ceaf946fb13865008ed413874d8fde8f613de061be92f106bf7a815b56b4480431dda
7
- data.tar.gz: 52f74d2b236ea7b5cf239262e9ddd310f74e3ba516c58221704a084ef81609d95df3ddcdc1699abccf3707a18dcf02c452d019c453b16447c5225c0592897b18
6
+ metadata.gz: c241a18d81b53800e41ea41c6157d3fd76f20d0cde9533508d427aa12010522f6ec684686648f33dc7091399c571873cdddda8053d2b0158b221c026b9c2b11f
7
+ data.tar.gz: c3b3a9a3922652a35eea531d50b21b81f69c9cef617548fea792eac9ca7555086f2472712a34efa7fafe4cccc2c57e2a74c26af96ea236b0cec9602d18b904da
@@ -18,7 +18,7 @@ class DataContract < Module
18
18
 
19
19
  def compatible?(other_obj)
20
20
  mod.instance_methods(false).each do |m|
21
- return false unless other_obj.respond_to? m
21
+ return false unless other_obj.respond_to?(m, true)
22
22
  end
23
23
  return true
24
24
  end
@@ -46,7 +46,11 @@ class DataContract < Module
46
46
 
47
47
  def assign(val, receiver, attribute)
48
48
  setter = "#{attribute}="
49
- raise ContractError, "The #{attribute} attribute cannot be assigned to #{receiver.class.name}" unless receiver.respond_to? setter
49
+
50
+ unless receiver.respond_to?(setter, true)
51
+ raise ContractError, "The #{attribute} attribute cannot be assigned to #{receiver.class.name}"
52
+ end
53
+
50
54
  receiver.send setter, val
51
55
  end
52
56
  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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Sans Collective