Module: Patm
Defined Under Namespace
Modules: DSL
Classes: CaseBinder, Match, NoMatchError, Pattern, Rule
Constant Summary
collapse
- EXACT =
Object.new
- PREDEF_GROUP_SIZE =
100
Class Method Summary
collapse
Class Method Details
.[](struct_klass) ⇒ Object
526
527
528
|
# File 'lib/patm.rb', line 526
def self.[](struct_klass)
Pattern::Struct::Builder.new(struct_klass)
end
|
._any ⇒ Object
502
503
504
|
# File 'lib/patm.rb', line 502
def self._any
@any ||= Pattern::Any.new
end
|
._xs ⇒ Object
506
507
508
|
# File 'lib/patm.rb', line 506
def self._xs
@xs = Pattern::ArrRest.new
end
|
.exact ⇒ Object
Use in Hash key. Specify exact match or not.
522
523
524
|
# File 'lib/patm.rb', line 522
def self.exact
EXACT
end
|
.match(plain_pat) ⇒ Object
.opt(pat = _any) ⇒ Object
Use in hash value. Mark this pattern is optional.
.or(*pats) ⇒ Object
498
499
500
|
# File 'lib/patm.rb', line 498
def self.or(*pats)
Pattern::Or.new(pats.map{|p| Pattern.build_from(p) })
end
|