Method: ContentData::ContentData#==

Defined in:
lib/content_data/content_data.rb

#==(other) ⇒ Object



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/content_data/content_data.rb', line 210

def ==(other)
  return false if other.nil?
  return false if @contents_info.size != other.contents_size
  other.each_instance { |checksum, size, content_mod_time, instance_mod_time, server, path|
     = @contents_info[checksum]
    return false if .nil?
    return false if [0] != size
    return false if [2] != content_mod_time
    #check instances
    local_instances =  [1]
    return false if other.instances_size(checksum) != local_instances.size
    location = [server, path]
    local_instance_mod_time = local_instances[location]
    return false if local_instance_mod_time.nil?
    return false if local_instance_mod_time != instance_mod_time
  }
  true
end