Sha256: a706c4bda664097f5e22efafdf03c0db73d4f61d8f987c8ea3a69010522672e3

Contents?: true

Size: 252 Bytes

Versions: 7

Compression:

Stored size: 252 Bytes

Contents

module Sniffles
  module Text   
    def parse(text)
      @doc = text
    end
  
    def match?(pattern)
      !!(pattern.match(@doc))
    end
    
    def capture(pattern)
      (captures = pattern.match(@doc)) ? captures[1] : false
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sniffles-0.1.5 lib/sniffles/text.rb
sniffles-0.1.4 lib/sniffles/text.rb
sniffles-0.1.3 lib/sniffles/text.rb
sniffles-0.1.2 lib/sniffles/text.rb
sniffles-0.1.1 lib/sniffles/text.rb
sniffles-0.1.0.1 lib/sniffles/text.rb
sniffles-0.1.0 lib/sniffles/text.rb