Class: Everypolitician::PullRequest::Report::Elections

Inherits:
Base
  • Object
show all
Defined in:
lib/everypolitician/pull_request/report/elections.rb

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 Everypolitician::PullRequest::Report::Base

Instance Method Details

#addedObject



11
12
13
# File 'lib/everypolitician/pull_request/report/elections.rb', line 11

def added
  elections(after.events - before.events)
end

#elections(events) ⇒ Object



5
6
7
8
9
# File 'lib/everypolitician/pull_request/report/elections.rb', line 5

def elections(events)
  events.select do |event|
    event if event.document[:classification] == 'general election'
  end
end

#removedObject



15
16
17
# File 'lib/everypolitician/pull_request/report/elections.rb', line 15

def removed
  elections(before.events - after.events)
end