Class: PullRequestSummarizer::Report::PeopleNames

Inherits:
Base
  • Object
show all
Defined in:
lib/pull_request_summarizer/report/people_names.rb

Direct Known Subclasses

PeopleAdditionalNames

Instance Attribute Summary

Attributes inherited from Base

#after, #before

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PullRequestSummarizer::Report::Base

Instance Method Details

#after_namesObject



8
9
10
# File 'lib/pull_request_summarizer/report/people_names.rb', line 8

def after_names
  @name_hash_post ||= Hash[after.persons.map { |p| [p.id, p.name] }]
end

#before_namesObject



4
5
6
# File 'lib/pull_request_summarizer/report/people_names.rb', line 4

def before_names
  @name_hash_pre ||= Hash[before.persons.map { |p| [p.id, p.name] }]
end

#changedObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/pull_request_summarizer/report/people_names.rb', line 12

def changed
  in_both = before_names.keys & after_names.keys
  in_both.select { |id| !before_names[id].casecmp(after_names[id].downcase).zero? }.map do |id|
    {
      id:  id,
      was: before_names[id],
      now: after_names[id],
    }
  end
end