class Showfix::Parser

Constants

PATTERNS

matchData pre_match / post_match for getting data after the matched part

Public Class Methods

new(options={}) click to toggle source
# File lib/showfix/parser.rb, line 26
def initialize(options={})
  @options = {}.merge(options)
end

Public Instance Methods

parse(string) click to toggle source

Parse a given string and look for matches

# File lib/showfix/parser.rb, line 31
def parse(string)

  matches = PATTERNS.map do |pattern|
    pattern.match(string)
  end.compact

  if matches.size > 0
    matches.first
  else
    nil
  end
end