Class: CC::Service::PullRequestsPresenter
- Inherits:
-
Object
- Object
- CC::Service::PullRequestsPresenter
- Includes:
- ActiveSupport::NumberHelper
- Defined in:
- lib/cc/presenters/pull_requests_presenter.rb
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(payload) ⇒ PullRequestsPresenter
constructor
A new instance of PullRequestsPresenter.
- #pending_message ⇒ Object
- #skipped_message ⇒ Object
- #success_message ⇒ Object
Constructor Details
#initialize(payload) ⇒ PullRequestsPresenter
Returns a new instance of PullRequestsPresenter.
6 7 8 9 10 11 12 13 |
# File 'lib/cc/presenters/pull_requests_presenter.rb', line 6 def initialize(payload) issue_comparison_counts = payload["issue_comparison_counts"] if issue_comparison_counts @fixed_count = issue_comparison_counts["fixed"] @new_count = issue_comparison_counts["new"] end end |
Instance Method Details
#error_message ⇒ Object
15 16 17 |
# File 'lib/cc/presenters/pull_requests_presenter.rb', line 15 def "Code Climate encountered an error attempting to analyze this pull request." end |
#pending_message ⇒ Object
19 20 21 |
# File 'lib/cc/presenters/pull_requests_presenter.rb', line 19 def "Code Climate is analyzing this code." end |
#skipped_message ⇒ Object
23 24 25 |
# File 'lib/cc/presenters/pull_requests_presenter.rb', line 23 def "Code Climate has skipped analysis of this commit." end |
#success_message ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/cc/presenters/pull_requests_presenter.rb', line 27 def if both_issue_counts_zero? "Code Climate didn't find any new or fixed issues." else "Code Climate found #{formatted_issue_counts}." end end |