Class: Travis::Client::LintResult
- Inherits:
-
Object
- Object
- Travis::Client::LintResult
- Defined in:
- lib/travis/client/lint_result.rb
Defined Under Namespace
Classes: Warning
Instance Attribute Summary collapse
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(payload) ⇒ LintResult
constructor
A new instance of LintResult.
- #ok? ⇒ Boolean
- #warnings? ⇒ Boolean
Constructor Details
#initialize(payload) ⇒ LintResult
Returns a new instance of LintResult.
7 8 9 10 11 12 13 14 |
# File 'lib/travis/client/lint_result.rb', line 7 def initialize(payload) @warnings = [] payload = payload['lint'] if payload['lint'] Array(payload['warnings']).each do |warning| @warnings << Warning.new(warning['key'], warning['message']) end end |
Instance Attribute Details
#warnings ⇒ Object
Returns the value of attribute warnings.
5 6 7 |
# File 'lib/travis/client/lint_result.rb', line 5 def warnings @warnings end |
Instance Method Details
#ok? ⇒ Boolean
20 21 22 |
# File 'lib/travis/client/lint_result.rb', line 20 def ok? !warnings? end |
#warnings? ⇒ Boolean
16 17 18 |
# File 'lib/travis/client/lint_result.rb', line 16 def warnings? warnings.any? end |