Class: CompareLinker::WebhookPayload

Inherits:
Object
  • Object
show all
Defined in:
lib/compare_linker/webhook_payload.rb

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ WebhookPayload

Returns a new instance of WebhookPayload.



5
6
7
8
# File 'lib/compare_linker/webhook_payload.rb', line 5

def initialize(payload)
  @payload = payload
  @json = JSON.parse(@payload)
end

Instance Method Details

#actionObject



10
11
12
# File 'lib/compare_linker/webhook_payload.rb', line 10

def action
  @json["action"]
end

#pr_numberObject



18
19
20
# File 'lib/compare_linker/webhook_payload.rb', line 18

def pr_number
  @json["number"]
end

#repo_full_nameObject



14
15
16
# File 'lib/compare_linker/webhook_payload.rb', line 14

def repo_full_name
  @json["repository"]["full_name"]
end