module Patm

Constants

EXACT
PREDEF_GROUP_SIZE

Public Class Methods

[](struct_klass) click to toggle source
# File lib/patm.rb, line 526
def self.[](struct_klass)
  Pattern::Struct::Builder.new(struct_klass)
end
_any() click to toggle source
# File lib/patm.rb, line 502
def self._any
  @any ||= Pattern::Any.new
end
_xs() click to toggle source
# File lib/patm.rb, line 506
def self._xs
  @xs = Pattern::ArrRest.new
end
exact() click to toggle source

Use in Hash key. Specify exact match or not.

# File lib/patm.rb, line 522
def self.exact
  EXACT
end
match(plain_pat) click to toggle source
# File lib/patm.rb, line 540
def self.match(plain_pat)
  CaseBinder.new Pattern.build_from(plain_pat)
end
opt(pat = _any) click to toggle source

Use in hash value. Mark this pattern is optional.

# File lib/patm.rb, line 512
def self.opt(pat = _any)
  Pattern::Opt.new(Pattern.build_from(pat))
end
or(*pats) click to toggle source
# File lib/patm.rb, line 498
def self.or(*pats)
  Pattern::Or.new(pats.map{|p| Pattern.build_from(p) })
end