Class: Travis::Client::LintResult

Inherits:
Object
  • Object
show all
Defined in:
lib/travis/client/lint_result.rb

Defined Under Namespace

Classes: Warning

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#warningsObject

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

Returns:

  • (Boolean)


20
21
22
# File 'lib/travis/client/lint_result.rb', line 20

def ok?
  !warnings?
end

#warnings?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/travis/client/lint_result.rb', line 16

def warnings?
  warnings.any?
end