Exception: Psych::SyntaxError
- Defined in:
- parser.c,
lib/psych/syntax_error.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#problem ⇒ Object
readonly
Returns the value of attribute problem.
Instance Method Summary collapse
-
#initialize(file, line, col, offset, problem, context) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
Constructor Details
#initialize(file, line, col, offset, problem, context) ⇒ SyntaxError
Returns a new instance of SyntaxError.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/psych/syntax_error.rb', line 5 def initialize file, line, col, offset, problem, context err = [problem, context].compact.join ' ' filename = file || '<unknown>' = "(%s): %s at line %d column %d" % [filename, err, line, col] @file = file @line = line @column = col @offset = offset @problem = problem @context = context super() end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column
3 4 5 |
# File 'lib/psych/syntax_error.rb', line 3 def column @column end |
#context ⇒ Object (readonly)
Returns the value of attribute context
3 4 5 |
# File 'lib/psych/syntax_error.rb', line 3 def context @context end |
#file ⇒ Object (readonly)
Returns the value of attribute file
3 4 5 |
# File 'lib/psych/syntax_error.rb', line 3 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line
3 4 5 |
# File 'lib/psych/syntax_error.rb', line 3 def line @line end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset
3 4 5 |
# File 'lib/psych/syntax_error.rb', line 3 def offset @offset end |
#problem ⇒ Object (readonly)
Returns the value of attribute problem
3 4 5 |
# File 'lib/psych/syntax_error.rb', line 3 def problem @problem end |