Exception: KXI::Exceptions::ParseException
- Inherits:
-
Exception
- Object
- Exception
- KXI::Exceptions::ParseException
- Defined in:
- lib/kxi/exceptions/parse_exception.rb
Overview
Raised when parser encounters an error
Instance Method Summary collapse
-
#initialize(parser, val) ⇒ ParseException
constructor
Instantiates the ParseException class.
-
#parser ⇒ string
Gets the name of the parser.
-
#value ⇒ any
Get the parsed value.
Constructor Details
#initialize(parser, val) ⇒ ParseException
Instantiates the KXI::Exceptions::ParseException class
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
#parser ⇒ string
Gets the name of the parser
15 16 17 |
# File 'lib/kxi/exceptions/parse_exception.rb', line 15 def parser @par end |
#value ⇒ any
Get the parsed value
9 10 11 |
# File 'lib/kxi/exceptions/parse_exception.rb', line 9 def value @val end |