Module: RightHook::Event

Defined in:
lib/right_hook/event.rb

Constant Summary collapse

ISSUE =
'issue'.freeze
PULL_REQUEST =
'pull_request'.freeze
ISSUE_COMMENT =
'issue_comment'.freeze
KNOWN_TYPES =
[
  ISSUE,
  PULL_REQUEST,
  ISSUE_COMMENT
].freeze

Class Method Summary collapse

Class Method Details

.github_name(event_type) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/right_hook/event.rb', line 4

def github_name(event_type)
  case event_type
  when ISSUE
    'issues'
  when PULL_REQUEST
    'pull_request'
  when ISSUE_COMMENT
    'issue_comment'
  else
    raise ArgumentError, "Unrecognized event_type: #{event_type}"
  end
end