Class: Lita::Extensions::GitHubWebHooksCore::Hooks::DeploymentStatus

Inherits:
Hook
  • Object
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

Constructor Details

This class inherits a constructor from Lita::Extensions::GitHubWebHooksCore::Hooks::Hook

Instance Method Details

#attributesObject



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

#deployObject



39
40
41
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 39

def deploy
  payload["deployment"]
end

#deployerObject



43
44
45
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 43

def deployer
  payload["sender"]["login"]
end

#deployment_descriptionObject



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

#environmentObject



31
32
33
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 31

def environment
  deploy["environment"]
end

#refObject



47
48
49
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 47

def ref
  deploy["ref"]
end

#shaObject



27
28
29
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 27

def sha
  deploy["sha"]
end

#start_timeObject



35
36
37
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 35

def start_time
  deploy["created_at"]
end

#statusObject



19
20
21
# File 'lib/lita/extensions/github_web_hooks_core/hooks/deployment_status.rb', line 19

def status
  payload["deployment_status"]["state"]
end