Class: Lita::Extensions::GitHubWebHooksCore::Hooks::Push

Inherits:
Hook
  • Object
show all
Includes:
RepoHooks
Defined in:
lib/lita/extensions/github_web_hooks_core/hooks/push.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



32
33
34
35
36
37
38
39
# File 'lib/lita/extensions/github_web_hooks_core/hooks/push.rb', line 32

def attributes
  {
    committer: committer,
    commit_count: commit_count,
    repo: repo,
    sender: sender
  }
end

#commit_countObject



24
25
26
# File 'lib/lita/extensions/github_web_hooks_core/hooks/push.rb', line 24

def commit_count
  payload["commits"].length.to_s
end

#committerObject



20
21
22
# File 'lib/lita/extensions/github_web_hooks_core/hooks/push.rb', line 20

def committer
  sender["login"]
end

#senderObject



28
29
30
# File 'lib/lita/extensions/github_web_hooks_core/hooks/push.rb', line 28

def sender
  payload["sender"]
end