Exception: DrgDSL::ParserError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/drgdsl/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parslet_error:, input:) ⇒ ParserError

Returns a new instance of ParserError.



7
8
9
10
# File 'lib/drgdsl/parser.rb', line 7

def initialize(parslet_error:, input:)
  @parslet_error = parslet_error
  @input = input
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



5
6
7
# File 'lib/drgdsl/parser.rb', line 5

def input
  @input
end

#parslet_errorObject (readonly)

Returns the value of attribute parslet_error.



5
6
7
# File 'lib/drgdsl/parser.rb', line 5

def parslet_error
  @parslet_error
end

Instance Method Details

#messageObject



12
13
14
# File 'lib/drgdsl/parser.rb', line 12

def message
  %{Failed to parse "#{input}"\nParslet::ParseFailed: #{parslet_error}}
end