Exception: Rsec::SyntaxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rsec/utils.rb

Overview

error class for rescue

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#colObject (readonly)

Returns the value of attribute col.



7
8
9
# File 'lib/rsec/utils.rb', line 7

def col
  @col
end

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/rsec/utils.rb', line 7

def line
  @line
end

#line_textObject (readonly)

Returns the value of attribute line_text.



7
8
9
# File 'lib/rsec/utils.rb', line 7

def line_text
  @line_text
end

#msgObject (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_sObject

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