rdfobjects 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rdf_objects/rdf_resource.rb +8 -1
  2. metadata +2 -2
@@ -191,6 +191,7 @@ module RDFObject
191
191
  end
192
192
 
193
193
  def ==(other)
194
+ return false unless other.is_a?(Resource) or other.is_a?(ResourceReference)
194
195
  return false unless self.uri == other.uri
195
196
  Curie.get_mappings.each do | prefix, uri |
196
197
  next unless self[uri] or other[uri]
@@ -203,10 +204,16 @@ module RDFObject
203
204
  self[uri].keys.each do | pred |
204
205
  if self[uri][pred].is_a?(Array)
205
206
  return false unless self[uri][pred].length == other[uri][pred].length
207
+ self[uri][pred].each do | idx |
208
+ return false unless other[uri][pred].index(idx)
209
+ end
210
+ other[uri][pred].each do | idx |
211
+ return false unless self[uri][pred].index(idx)
212
+ end
206
213
  else
207
214
  if self[uri][pred].is_a?(Resource) or self[uri][pred].is_a?(ResourceReference)
208
215
  return false unless other[uri][pred].is_a?(Resource) or other[uri][pred].is_a?(ResourceReference)
209
- return false unless self.uri == other.uri
216
+ return false unless self[uri][pred].uri == other[uri][pred].uri
210
217
  else
211
218
  return false unless self[uri][pred] == other[uri][pred]
212
219
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdfobjects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Singer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-11 00:00:00 -05:00
12
+ date: 2009-11-23 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency