Class: Lita::Extensions::GitHubWebHooksCore::Hooks::DeploymentStatus
- Inherits:
-
Hook
- Object
- Hook
- Lita::Extensions::GitHubWebHooksCore::Hooks::DeploymentStatus
show all
- Includes:
- RepoHooks
- Defined in:
- lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb
Instance Attribute Summary
Attributes inherited from Hook
#payload
Instance Method Summary
collapse
Methods included from RepoHooks
#access_token, #client, #repo, #repository
Methods inherited from Hook
#initialize
Instance Method Details
#attributes ⇒ Object
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 51
def attributes
{
status: status,
deployment_description: deployment_description,
ref: ref,
repo: repo,
sha: sha,
environment: environment,
start_time: start_time,
deploy: deploy,
deployer: deployer
}
end
|
#deploy ⇒ Object
39
40
41
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 39
def deploy
payload["deployment"]
end
|
#deployer ⇒ Object
43
44
45
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 43
def deployer
payload["sender"]["login"]
end
|
#deployment_description ⇒ Object
23
24
25
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 23
def deployment_description
[deploy["description"], status].join(": ")
end
|
#environment ⇒ Object
31
32
33
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 31
def environment
deploy["environment"]
end
|
#ref ⇒ Object
47
48
49
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 47
def ref
deploy["ref"]
end
|
#sha ⇒ Object
27
28
29
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 27
def sha
deploy["sha"]
end
|
#start_time ⇒ Object
35
36
37
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 35
def start_time
deploy["created_at"]
end
|
#status ⇒ Object
19
20
21
|
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 19
def status
payload["deployment_status"]["state"]
end
|