Class: L43Rmap::Parsing::Input

Inherits:
Object
  • Object
show all
Extended by:
L43::OpenObject
Defined in:
lib/l43_rmap/parsing/input.rb

Instance Method Summary collapse

Instance Method Details

#advance(by = 1) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/l43_rmap/parsing/input.rb', line 12

def advance(by=1)
  by = by.length if String === by
  update(
    current: current.slice(by..) || '',
    parsed: parsed << current.slice(0...by),
    pos: pos + by)
end

#empty?Boolean

Returns:

  • (Boolean)


20
# File 'lib/l43_rmap/parsing/input.rb', line 20

def empty? = current == ''

#show(n = 10) ⇒ Object



22
# File 'lib/l43_rmap/parsing/input.rb', line 22

def show(n=10) = [current[0...n].inspect, pos].join(" at position:")