class Collector

class for sc

Public Class Methods

new(pattern) click to toggle source
# File lib/collectors.rb, line 4
def initialize(pattern)
  @pattern = pattern
  @bin = []
end

Public Instance Methods

input(string) click to toggle source
# File lib/collectors.rb, line 8
def input(string)
  if string =~ @pattern
    @bin << string
  end
end
ismatch(string) click to toggle source

tests for a match

# File lib/collectors.rb, line 14
def ismatch(string)
  (string =~ @pattern) ? true : false
end
matches() click to toggle source
# File lib/collectors.rb, line 17
def matches
  @bin
end