Method: ContentData.merge
- Defined in:
- lib/content_data/content_data.rb
.merge(a, b) ⇒ Object
merges content data a and content data b to a new content data and returns it.
816 817 818 819 820 821 822 823 824 825 |
# File 'lib/content_data/content_data.rb', line 816 def self.merge(a, b) return ContentData.new(a) if b.nil? return ContentData.new(b) if a.nil? c = ContentData.new(b) # Add A instances to content data c a.each_instance { |checksum, size, content_mod_time, instance_mod_time, server, path| c.add_instance(checksum, size, server, path, instance_mod_time) } c end |