class RPStringScanner

Public Instance Methods

d(o) click to toggle source
# File lib/rp_stringscanner.rb, line 29
def d o
  STDERR.puts o.inspect
end
getch() click to toggle source
Calls superclass method
# File lib/rp_stringscanner.rb, line 5
def getch
  c = super
  where = caller.drop_while { |s| s =~ /(getch|nextc).$/ }.first
  where = where.split(/:/).first(2).join(":")
  if ENV["TALLY"] then
    d getch:where
  else
    d getch:[c, where]
  end
  c
end
scan(re) click to toggle source
Calls superclass method
# File lib/rp_stringscanner.rb, line 17
def scan re
  s = super
  where = caller.drop_while { |x| x =~ /scan.$/ }.first
  where = where.split(/:/).first(2).join(":")
  if ENV["TALLY"] then
    d scan:[where]
  else
    d scan:[s, where] if s
  end
  s
end