class Turnstile::Collector::RegexpMatcher
Public Instance Methods
matches?(line)
click to toggle source
# File lib/turnstile/collector/regexp_matcher.rb, line 15 def matches?(line) regexp && regexp.match(line) end
tokenize(line)
click to toggle source
runs it through extractor
to grab the token
@param [String] line read from a log file @return [String] a token in the form 'platform:ip:user'
# File lib/turnstile/collector/regexp_matcher.rb, line 10 def tokenize(line) return nil unless matches?(line) && extractor extractor[line] end