Exception: KXI::Exceptions::ParseException

Inherits:
Exception
  • Object
show all
Defined in:
lib/kxi/exceptions/parse_exception.rb

Overview

Raised when parser encounters an error

Instance Method Summary collapse

Constructor Details

#initialize(parser, val) ⇒ ParseException

Instantiates the KXI::Exceptions::ParseException class

Parameters:

  • parser (string)

    Name of the parser

  • val (any)

    Parsed value



22
23
24
25
26
# File 'lib/kxi/exceptions/parse_exception.rb', line 22

def initialize(parser, val)
	super("Failed to parse value '#{val.to_s}' as #{parser}!")
	@par = parser
	@val = val
end

Instance Method Details

#parserstring

Gets the name of the parser

Returns:

  • (string)

    Name of the parser



15
16
17
# File 'lib/kxi/exceptions/parse_exception.rb', line 15

def parser
	@par
end

#valueany

Get the parsed value

Returns:

  • (any)

    Parsed value



9
10
11
# File 'lib/kxi/exceptions/parse_exception.rb', line 9

def value
	@val
end