Class: Juicer::JsLint::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/juicer/jslint.rb

Overview

Represents the results of a JsLint run

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors = []) ⇒ Report

Returns a new instance of Report.



61
62
63
# File 'lib/juicer/jslint.rb', line 61

def initialize(errors = [])
  @errors = errors
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



59
60
61
# File 'lib/juicer/jslint.rb', line 59

def errors
  @errors
end

Instance Method Details

#add_error(message, code) ⇒ Object



65
66
67
# File 'lib/juicer/jslint.rb', line 65

def add_error(message, code)
  @errors << JsLint::Error.new(message, code)
end

#ok?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/juicer/jslint.rb', line 69

def ok?
  @errors.nil? || @errors.length == 0
end