123456789_123456789_123456789_123456789_123456789_

Class: RBS::CharScanner

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, StringScanner
Instance Chain:
self, StringScanner
Inherits: StringScanner
  • Object
Defined in: lib/rbs/char_scanner.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(string) ⇒ CharScanner

[ GitHub ]

  
# File 'lib/rbs/char_scanner.rb', line 3

def initialize(string)
  super(string)
  @charpos = 0
end

Instance Method Details

#charpos

[ GitHub ]

  
# File 'lib/rbs/char_scanner.rb', line 10

def charpos
  @charpos
end

#original_charpos

[ GitHub ]

  
# File 'lib/rbs/char_scanner.rb', line 8

alias original_charpos charpos

#scan(pattern)

[ GitHub ]

  
# File 'lib/rbs/char_scanner.rb', line 14

def scan(pattern)
  s = super
  @charpos += s.size if s
  s
end