restful_resource 0.8.11 → 0.8.12

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: b82732fc3f5e565d9fb2d5bd5ba200d0194eed78
4
- data.tar.gz: 9c7a6b1231a6a9555f7f2a4980043360ec719e97
3
+ metadata.gz: eed783eddea74a4d5c4b15dcaf9d12ed450d8957
4
+ data.tar.gz: 2de3afb79d0a6883a224f23f42b4801ab0ab2a8c
5
5
  SHA512:
6
- metadata.gz: da23092828e8d2ff80a487d9735d6c13775a99d601530f74d1200c2b13b5cbe953ac55b4232dc5f0ba9576b49c6a0439dd6792eeb9ad391fa0e02be848845b6a
7
- data.tar.gz: de2e9e657a43ea8b6274377784c9c42bc0184a3187c7cc6da8d692e250cd6a6cd950a8e88d3806b0634e38204b7a4e072007223880ef3f2ee991141ab5328eee
6
+ metadata.gz: f537e3a7bc25bc255aa5b7b6fafff90651a592c7252f80452fbbafccd5a24a863808a372f5743d93cb657538d5563584f1fb62b6e0b65e11b8f84027d2e912f0
7
+ data.tar.gz: 241d7d7669cccd17480faf00e5c0fb6c88a678b5b8a886d62b1c45457308294d4a8f29e906b903b77b1efe5e5aa121154e93e1b43984cce99e20e051d8a55ec1
@@ -19,5 +19,17 @@ module RestfulResource
19
19
  def as_json(options=nil)
20
20
  @inner_object.send(:table).as_json(options)
21
21
  end
22
+
23
+ def ==(other)
24
+ @inner_object == other.instance_variable_get(:@inner_object)
25
+ end
26
+
27
+ def eql?(other)
28
+ @inner_object.eql?(other.instance_variable_get(:@inner_object))
29
+ end
30
+
31
+ def equal?(other)
32
+ @inner_object.equal?(other.instance_variable_get(:@inner_object))
33
+ end
22
34
  end
23
35
  end
@@ -1,3 +1,3 @@
1
1
  module RestfulResource
2
- VERSION = "0.8.11"
2
+ VERSION = "0.8.12"
3
3
  end
@@ -13,4 +13,18 @@ describe RestfulResource::OpenObject do
13
13
 
14
14
  expect { object.age }.to raise_error(NoMethodError)
15
15
  end
16
+
17
+ it "should implement equality operators correctly" do
18
+ a = RestfulResource::OpenObject.new({name: 'Joe', age: 13})
19
+ b = RestfulResource::OpenObject.new({name: 'Joe', age: 13})
20
+ c = RestfulResource::OpenObject.new({name: 'Mike', age: 13})
21
+
22
+ expect(a == b).to eq true
23
+ expect(a.eql?(b)).to eq true
24
+ expect(a.equal?(b)).to eq false
25
+
26
+ expect(a == c).to eq false
27
+ expect(a.eql?(c)).to eq false
28
+ expect(a.equal?(c)).to eq false
29
+ end
16
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.11
4
+ version: 0.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoro