class List::Matcher::Alternate

Public Class Methods

new(engine, symbols, list) click to toggle source
Calls superclass method List::Matcher::Node::new
# File lib/list_matcher.rb, line 745
def initialize(engine, symbols, list)
  super(engine, nil)
  @children = list.group_by{ |s| s[0] }.values.map{ |ar| engine.tree( ar, symbols ) }
end

Public Instance Methods

atomic?() click to toggle source
# File lib/list_matcher.rb, line 756
def atomic?
  !root?
end
convert() click to toggle source
# File lib/list_matcher.rb, line 750
def convert
  rx = children.map(&:convert).join('|')
  rx = wrap(rx) unless root?
  finalize rx
end