Class: Linterbot::CommitApprover
- Inherits:
-
Object
- Object
- Linterbot::CommitApprover
- Defined in:
- lib/linterbot/commit_approver.rb
Instance Attribute Summary collapse
-
#github_client ⇒ Object
Returns the value of attribute github_client.
Instance Method Summary collapse
- #approve(repository, sha) ⇒ Object
- #error(repository, sha) ⇒ Object
-
#initialize(github_client) ⇒ CommitApprover
constructor
A new instance of CommitApprover.
- #pending(repository, sha) ⇒ Object
- #reject(repository, sha, serious_violations_count) ⇒ Object
Constructor Details
#initialize(github_client) ⇒ CommitApprover
Returns a new instance of CommitApprover.
7 8 9 |
# File 'lib/linterbot/commit_approver.rb', line 7 def initialize(github_client) @github_client = github_client end |
Instance Attribute Details
#github_client ⇒ Object
Returns the value of attribute github_client.
5 6 7 |
# File 'lib/linterbot/commit_approver.rb', line 5 def github_client @github_client end |
Instance Method Details
#approve(repository, sha) ⇒ Object
11 12 13 |
# File 'lib/linterbot/commit_approver.rb', line 11 def approve(repository, sha) github_client.create_status(repository, sha, "success", context: context, description: approve_description) end |
#error(repository, sha) ⇒ Object
23 24 25 |
# File 'lib/linterbot/commit_approver.rb', line 23 def error(repository, sha) github_client.create_status(repository, sha, "error", context: context) end |
#pending(repository, sha) ⇒ Object
19 20 21 |
# File 'lib/linterbot/commit_approver.rb', line 19 def pending(repository, sha) github_client.create_status(repository, sha, "pending", context: context) end |
#reject(repository, sha, serious_violations_count) ⇒ Object
15 16 17 |
# File 'lib/linterbot/commit_approver.rb', line 15 def reject(repository, sha, serious_violations_count) github_client.create_status(repository, sha, "failure", context: context, description: reject_description(serious_violations_count)) end |