Class: Wherewolf::ParseError
- Inherits:
-
Parslet::ParseFailed
- Object
- Parslet::ParseFailed
- Wherewolf::ParseError
- Defined in:
- lib/wherewolf/parse_error.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(parent) ⇒ ParseError
constructor
A new instance of ParseError.
- #position ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(parent) ⇒ ParseError
Returns a new instance of ParseError.
4 5 6 |
# File 'lib/wherewolf/parse_error.rb', line 4 def initialize(parent) @parent = parent end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
3 4 5 |
# File 'lib/wherewolf/parse_error.rb', line 3 def parent @parent end |
Instance Method Details
#error_message ⇒ Object
12 13 14 |
# File 'lib/wherewolf/parse_error.rb', line 12 def "Parsing error occured at character #{position}" end |
#position ⇒ Object
8 9 10 |
# File 'lib/wherewolf/parse_error.rb', line 8 def position parent.cause.source.pos end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/wherewolf/parse_error.rb', line 16 def to_s end |