class List::Matcher::Node
Attributes
engine[RW]
optional[RW]
root[RW]
symbols[RW]
Public Class Methods
new(engine, symbols)
click to toggle source
# File lib/list_matcher.rb, line 454 def initialize(engine, symbols) @engine = engine @symbols = symbols @children = [] end
Public Instance Methods
atomic?()
click to toggle source
# File lib/list_matcher.rb, line 504 def atomic? false end
bound()
click to toggle source
# File lib/list_matcher.rb, line 468 def bound engine.bound end
children()
click to toggle source
# File lib/list_matcher.rb, line 476 def children @children ||= [] end
convert()
click to toggle source
# File lib/list_matcher.rb, line 480 def convert raise NotImplementedError end
finalize(rx)
click to toggle source
# File lib/list_matcher.rb, line 492 def finalize(rx) if optional? rx = wrap rx unless atomic? rx += qmark end rx end
flatten()
click to toggle source
# File lib/list_matcher.rb, line 460 def flatten children.each{ |c| c.flatten } end
optional?()
click to toggle source
# File lib/list_matcher.rb, line 472 def optional? optional end
optionalize(bool)
click to toggle source
# File lib/list_matcher.rb, line 512 def optionalize(bool) if bool self.optional = bool end self end
pfx()
click to toggle source
# File lib/list_matcher.rb, line 484 def pfx engine.pfx end
qmark()
click to toggle source
# File lib/list_matcher.rb, line 488 def qmark engine.qmark end
quote(s)
click to toggle source
# File lib/list_matcher.rb, line 508 def quote(s) engine.quote s end
root?()
click to toggle source
# File lib/list_matcher.rb, line 464 def root? root end
wrap(s)
click to toggle source
# File lib/list_matcher.rb, line 500 def wrap(s) engine.wrap s end