Exception: Rsec::SyntaxError
- Inherits:
-
StandardError
- Object
- StandardError
- Rsec::SyntaxError
- Defined in:
- lib/rsec/utils.rb
Overview
error class for rescue
Instance Attribute Summary collapse
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#line_text ⇒ Object
readonly
Returns the value of attribute line_text.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
Instance Method Summary collapse
-
#initialize(msg, line_text, line, col) ⇒ SyntaxError
constructor
constructor.
-
#to_s ⇒ Object
info with source position.
Constructor Details
#initialize(msg, line_text, line, col) ⇒ SyntaxError
constructor
10 11 12 |
# File 'lib/rsec/utils.rb', line 10 def initialize msg, line_text, line, col @msg, @line_text, @line, @col = msg, line_text, line, col end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
7 8 9 |
# File 'lib/rsec/utils.rb', line 7 def col @col end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
7 8 9 |
# File 'lib/rsec/utils.rb', line 7 def line @line end |
#line_text ⇒ Object (readonly)
Returns the value of attribute line_text.
7 8 9 |
# File 'lib/rsec/utils.rb', line 7 def line_text @line_text end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
7 8 9 |
# File 'lib/rsec/utils.rb', line 7 def msg @msg end |
Instance Method Details
#to_s ⇒ Object
info with source position
15 16 17 |
# File 'lib/rsec/utils.rb', line 15 def to_s %Q<#@msg\n#@line_text\n#{' ' * @col}^> end |