Class: Lita::Reviewme::Github
- Inherits:
-
Object
- Object
- Lita::Reviewme::Github
- Extended by:
- Forwardable
- Defined in:
- lib/lita-reviewme/github.rb
Defined Under Namespace
Classes: CannotPostComment, UnknownOwner
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#pr_id ⇒ Object
readonly
Returns the value of attribute pr_id.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #assign(reviewer) ⇒ Object
-
#initialize(config, repo, pr_id) ⇒ Github
constructor
A new instance of Github.
- #owner ⇒ Object
Constructor Details
#initialize(config, repo, pr_id) ⇒ Github
20 21 22 23 24 |
# File 'lib/lita-reviewme/github.rb', line 20 def initialize(config, repo, pr_id) @config = config @repo = repo @pr_id = pr_id end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
11 12 13 |
# File 'lib/lita-reviewme/github.rb', line 11 def config @config end |
#pr_id ⇒ Object (readonly)
Returns the value of attribute pr_id.
11 12 13 |
# File 'lib/lita-reviewme/github.rb', line 11 def pr_id @pr_id end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
11 12 13 |
# File 'lib/lita-reviewme/github.rb', line 11 def repo @repo end |
Instance Method Details
#assign(reviewer) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/lita-reviewme/github.rb', line 32 def assign(reviewer) request_review(reviewer) if github_request_review add_comment(reviewer) if github_comment rescue Octokit::Error raise CannotPostComment end |
#owner ⇒ Object
26 27 28 29 30 |
# File 'lib/lita-reviewme/github.rb', line 26 def owner pull_request.user.login rescue Octokit::Error raise UnknownOwner end |