Exception: Traceur::CompilationError
- Inherits:
-
StandardError
- Object
- StandardError
- Traceur::CompilationError
- Defined in:
- lib/traceur/compilation_error.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(errors) ⇒ CompilationError
constructor
A new instance of CompilationError.
Constructor Details
#initialize(errors) ⇒ CompilationError
Returns a new instance of CompilationError.
5 6 7 8 |
# File 'lib/traceur/compilation_error.rb', line 5 def initialize(errors) @errors = errors super(errors.map(&:to_s).join("\n")) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/traceur/compilation_error.rb', line 3 def errors @errors end |
Class Method Details
.parse(error_string) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/traceur/compilation_error.rb', line 10 def self.parse(error_string) lines = error_string.split("\n") errors = lines.map do |line| file, line, column, = line.split(':') Error.new(file.strip, line.to_i, column.to_i, .strip) end new(errors) end |