Class: Codebot::Formatters::PullRequestReviewComment
Overview
This class formats pull_request_review_comment events.
Instance Attribute Summary
#payload
Instance Method Summary
collapse
#abbreviate, #action, #ary_to_sentence, #closed?, #extract, #format_branch, #format_dangerous, #format_event, #format_hash, #format_number, #format_repository, #format_url, #format_user, #gitlab_action, #gitlab_closed?, #gitlab_opened?, #gitlab_repository_url, #gitlab_url, #initialize, #opened?, #prettify, #repository_name, #repository_url, #sanitize, #sender_name, #shorten_url, #url
Instance Method Details
#comment_body ⇒ Object
36
37
38
|
# File 'lib/codebot/formatters/pull_request_review_comment.rb', line 36
def comment_body
(:comment, :body)
end
|
#commit_id ⇒ Object
40
41
42
|
# File 'lib/codebot/formatters/pull_request_review_comment.rb', line 40
def commit_id
(:comment, :commit_id)
end
|
27
28
29
30
|
# File 'lib/codebot/formatters/pull_request_review_comment.rb', line 27
def default_format
'[%<repository>s] %<sender>s commented on pull request #%<number>s ' \
'%<hash>s: %<summary>s'
end
|
Formats IRC messages for a pull_request_review_comment event.
13
14
15
|
# File 'lib/codebot/formatters/pull_request_review_comment.rb', line 13
def format
["#{summary}: #{format_url url}"]
end
|
#pull_number ⇒ Object
44
45
46
|
# File 'lib/codebot/formatters/pull_request_review_comment.rb', line 44
def pull_number
(:pull_request, :number)
end
|
#summary ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'lib/codebot/formatters/pull_request_review_comment.rb', line 17
def summary
default_format % {
repository: format_repository(repository_name),
sender: format_user(sender_name),
number: pull_number,
hash: format_hash(commit_id),
short: prettify(comment_body)
}
end
|
#summary_url ⇒ Object
32
33
34
|
# File 'lib/codebot/formatters/pull_request_review_comment.rb', line 32
def summary_url
(:comment, :html_url).to_s
end
|