class Fabricator::Vertical_Peeker::Pointered_String

Attributes

pointer[RW]

Public Class Methods

new(value) click to toggle source
Calls superclass method
# File lib/mau/fabricator.rb, line 605
def initialize value
  super value
  @pointer = 0
  return
end

Public Instance Methods

ahead(length) click to toggle source
# File lib/mau/fabricator.rb, line 625
def ahead length
  return self[@pointer, length]
end
at?(etalon) click to toggle source
# File lib/mau/fabricator.rb, line 634
def at? etalon
  return ahead(etalon.length) == etalon
end
biu_starter?(c) click to toggle source
# File lib/mau/fabricator.rb, line 613
def biu_starter? c
  return char_ahead == c &&
      char_ahead(-1) != c &&
      ![?\s, c].include?(char_ahead(1))
end
biu_terminator?(c) click to toggle source
# File lib/mau/fabricator.rb, line 619
def biu_terminator? c
  return char_ahead == c &&
      char_ahead(1) != c &&
      ![?\s, c].include?(char_ahead(-1))
end
char_ahead(delta = 0) click to toggle source
# File lib/mau/fabricator.rb, line 629
def char_ahead delta = 0
  offset = @pointer + delta
  return offset >= 0 ? self[offset] : nil
end