class Kommando::Matchers::Every

Public Class Methods

new(regexp, block) click to toggle source
Calls superclass method Kommando::Matchers::Base::new
# File lib/kommando/matchers/every.rb, line 2
def initialize(regexp, block)
  super regexp, block
  @cursor = 0
end

Public Instance Methods

match(string) click to toggle source
# File lib/kommando/matchers/every.rb, line 7
def match(string)
  match_data = string[@cursor..-1].match(@regexp)
  @cursor = string.length if match_data
  match_data
end
skip_by(string) click to toggle source
# File lib/kommando/matchers/every.rb, line 13
def skip_by(string)
  @cursor = string.length
end