Class: JMESPath::Lexer::CharacterStream Private

Inherits:
Object
  • Object
show all
Defined in:
lib/jmespath/lexer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(chars) ⇒ CharacterStream

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CharacterStream.



332
333
334
335
# File 'lib/jmespath/lexer.rb', line 332

def initialize(chars)
  @chars = chars
  @position = 0
end

Instance Method Details

#currentObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



337
338
339
# File 'lib/jmespath/lexer.rb', line 337

def current
  @chars[@position]
end

#nextObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



341
342
343
344
# File 'lib/jmespath/lexer.rb', line 341

def next
  @position += 1
  @chars[@position]
end

#positionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



346
347
348
# File 'lib/jmespath/lexer.rb', line 346

def position
  @position
end