Class: JSHint4r::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/jshint4r/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, errors) ⇒ Result

Returns a new instance of Result.



3
4
5
6
# File 'lib/jshint4r/result.rb', line 3

def initialize( target, errors )
  @target = target
  @errors = parse( errors )
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



7
8
9
# File 'lib/jshint4r/result.rb', line 7

def errors
  @errors
end

#targetObject (readonly)

Returns the value of attribute target.



7
8
9
# File 'lib/jshint4r/result.rb', line 7

def target
  @target
end

Instance Method Details

#parse(errors) ⇒ Object

param

String errors

return

Object

Raises:

  • (TypeError)


13
14
15
16
17
# File 'lib/jshint4r/result.rb', line 13

def parse( errors )
  errors = errors || ''
  raise TypeError unless errors.is_a? String
  ExecJS.eval( errors )
end