Class: Hubstats::EventsHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/hubstats/events_handler.rb

Instance Method Summary collapse

Instance Method Details

#route(payload, type) ⇒ Object

Public - Processes comments and PRs

payload - the data that we will be processing type - the type of data that payload is

Returns - nothing



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/hubstats/events_handler.rb', line 9

def route(payload, type)
  case type
  when "issue_comment", "IssueCommentEvent"
    comment_processor(payload, "Issue") # comment on a pull request
  when "commit_comment", "CommitCommentEvent"
    comment_processor(payload, "Commit") # comment on a pull request commit
  when "pull_request_review_comment", "PullRequestReviewCommentEvent"
    comment_processor(payload, "PullRequest") # comment on a pull request review
  when "pull_request", "PullRequestEvent"
    pull_processor(payload) # new pull request
  when "membership", "MembershipEvent", "team", "TeamEvent"
    team_processor(payload) # adding/editing/deleting/modifying teams
  when "repository", "RepositoryEvent"
    repository_processor(payload) # adding repositories
  end
end