Module: GitHub::Payload::Helpers::Issues

Includes:
Actions, Meta
Included in:
Formatter::IssueCommentEvent, Formatter::IssuesEvent
Defined in:
lib/github/payload/helpers/issues.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Meta

#repo, #sender

Methods included from Actions

#action, #opened?

Class Method Details

.sample_payloadObject



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/github/payload/helpers/issues.rb', line 27

def self.sample_payload
  Service::HelpersWithMeta.sample_payload.merge(
    "action" => "opened",
    "issue" => {
    "number" => 5,
    "state" => "open",
    "title" => "booya",
    "body"  => "boom town",
    "user" => { "login" => "mojombo" }
  }
  )
end

Instance Method Details

#issueObject



7
8
9
# File 'lib/github/payload/helpers/issues.rb', line 7

def issue
  @issue ||= self.class.objectify(payload['issue'])
end

#summary_messageObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/github/payload/helpers/issues.rb', line 15

def summary_message
  "[%s] %s %s issue #%d: %s." % [
    repo.name,
    sender.,
    action,
    issue.number,
    issue.title,
  ]
rescue
  raise_config_error "Unable to build message: #{$!.to_s}"
end

#summary_urlObject



11
12
13
# File 'lib/github/payload/helpers/issues.rb', line 11

def summary_url
  issue.html_url
end