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.


73
74
75
# File 'lib/juicer/jslint.rb', line 73

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

Instance Attribute Details

#errorsObject

Returns the value of attribute errors


71
72
73
# File 'lib/juicer/jslint.rb', line 71

def errors
  @errors
end

Instance Method Details

#add_error(message, code) ⇒ Object


77
78
79
# File 'lib/juicer/jslint.rb', line 77

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

#ok?Boolean

Returns:

  • (Boolean)

81
82
83
# File 'lib/juicer/jslint.rb', line 81

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