Class: JslintRb::Error
- Inherits:
-
Object
- Object
- JslintRb::Error
- Defined in:
- lib/jslint-rb/error.rb
Overview
This object encapsulates the output from JSHint. Does some minimal formatting
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Column number of the JSHint error.
-
#evidence ⇒ Object
readonly
The snippet of code that caused the error.
-
#line_number ⇒ Object
readonly
Line number the JSHint error occured on.
-
#reason ⇒ Object
readonly
The actual error that was discovered.
Instance Method Summary collapse
-
#initialize(jsobject) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(jsobject) ⇒ Error
Returns a new instance of Error.
19 20 21 22 23 24 25 |
# File 'lib/jslint-rb/error.rb', line 19 def initialize(jsobject) @line_number = jsobject["line"] @character = jsobject["character"] @reason = jsobject["reason"] @evidence = jsobject["evidence"] @evidence.strip! unless @evidence.nil? end |
Instance Attribute Details
#character ⇒ Object (readonly)
Column number of the JSHint error
11 12 13 |
# File 'lib/jslint-rb/error.rb', line 11 def character @character end |
#evidence ⇒ Object (readonly)
The snippet of code that caused the error
17 18 19 |
# File 'lib/jslint-rb/error.rb', line 17 def evidence @evidence end |
#line_number ⇒ Object (readonly)
Line number the JSHint error occured on
8 9 10 |
# File 'lib/jslint-rb/error.rb', line 8 def line_number @line_number end |
#reason ⇒ Object (readonly)
The actual error that was discovered
14 15 16 |
# File 'lib/jslint-rb/error.rb', line 14 def reason @reason end |