Module: Patm

Defined in:
lib/patm.rb

Defined Under Namespace

Modules: DSL Classes: CaseBinder, Match, Pattern, Rule, RuleCache

Constant Summary collapse

EXACT =
Object.new
PREDEF_GROUP_SIZE =
100

Class Method Summary collapse

Class Method Details

._anyObject



394
395
396
# File 'lib/patm.rb', line 394

def self._any
  @any ||= Pattern::Any.new
end

._xsObject



398
399
400
# File 'lib/patm.rb', line 398

def self._xs
  @xs = Pattern::ArrRest.new
end

.exactObject

Use in Hash key. Specify exact match or not.



414
415
416
# File 'lib/patm.rb', line 414

def self.exact
  EXACT
end

.match(plain_pat) ⇒ Object



428
429
430
# File 'lib/patm.rb', line 428

def self.match(plain_pat)
  CaseBinder.new Pattern.build_from(plain_pat)
end

.opt(pat = _any) ⇒ Object

Use in hash value. Mark this pattern is optional.



404
405
406
# File 'lib/patm.rb', line 404

def self.opt(pat = _any)
  Pattern::Opt.new(Pattern.build_from(pat))
end

.or(*pats) ⇒ Object



390
391
392
# File 'lib/patm.rb', line 390

def self.or(*pats)
  Pattern::Or.new(pats.map{|p| Pattern.build_from(p) })
end