Method: ContentData::ContentData#unify_time

Defined in:
lib/content_data/content_data.rb

#unify_timeObject

for each content, all time fields (content and instances) are replaced with the min time found, while going through all time fields.



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/content_data/content_data.rb', line 501

def unify_time()
  contents_enum = @contents_info.each_key
  loop {
    checksum = contents_enum.next rescue break
     = @contents_info[checksum]
    min_time_per_checksum = [2]
    instances = [1]
    instances_enum = instances.each_key
    loop {
      location = instances_enum.next rescue break
      instance_mod_time = instances[location][0]
      if instance_mod_time < min_time_per_checksum
        min_time_per_checksum = instance_mod_time
      end
    }
    # update all instances with min time
    instances_enum = instances.each_key
    loop {
      location = instances_enum.next rescue break
      instances[location][0] = min_time_per_checksum
    }
    # update content time with min time
    [2] = min_time_per_checksum
  }
end