Module: DdeService::Matcher

Defined in:
app/services/dde/matcher.rb

Overview

Matches local and remote (Dde) people.

TODO: Move module to own file

Class Method Summary collapse

Class Method Details

.find_differences(local_person, remote_person) ⇒ Object



10
11
12
13
14
15
# File 'app/services/dde/matcher.rb', line 10

def find_differences(local_person, remote_person)
  FIELDS_TO_MATCH
    .map { |field| [field, diff_field(field, local_person, remote_person)] }
    .reject { |_field, diff| diff.nil? }
    .each_with_object({}) { |sub_diff, diff| diff[sub_diff[0]] = sub_diff[1] }
end