Class: RParsec::Failure

Inherits:
Object
  • Object
show all
Defined in:
lib/rparsec/error.rb

Direct Known Subclasses

Expected

Constant Summary collapse

Precedence =
100

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ind, input, message = nil) ⇒ Failure

Returns a new instance of Failure.



10
11
12
# File 'lib/rparsec/error.rb', line 10

def initialize(ind, input, message = nil)
  @index, @input, @msg = ind, input, message
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



14
15
16
# File 'lib/rparsec/error.rb', line 14

def index
  @index
end

#inputObject (readonly)

Returns the value of attribute input.



14
15
16
# File 'lib/rparsec/error.rb', line 14

def input
  @input
end

Instance Method Details

#msgObject



17
18
19
# File 'lib/rparsec/error.rb', line 17

def msg
  return @msg.to_s
end