class Terrestrial::Cli::EntryCollectionDiffer
Public Class Methods
additions(first, second)
click to toggle source
# File lib/terrestrial/cli/entry_collection_differ.rb, line 11 def self.additions(first, second) second.reject do |b| first.any? {|a| match?(a, b) } end end
match?(a, b)
click to toggle source
# File lib/terrestrial/cli/entry_collection_differ.rb, line 17 def self.match?(a, b) a.fetch("identifier") == b.fetch("identifier") end
omissions(first, second)
click to toggle source
# File lib/terrestrial/cli/entry_collection_differ.rb, line 5 def self.omissions(first, second) first.select do |a| !second.any? {|b| match?(a, b)} end end