Class: RBNF::Alt
Overview
Alternation node
Constant Summary
Constants included from RBNF
Instance Attribute Summary
Attributes inherited from Binary
Instance Method Summary collapse
-
#initialize(a, b) ⇒ Alt
constructor
A new instance of Alt.
- #match(s) ⇒ Object
- #to_s ⇒ Object
Methods included from RBNF
#=~, [], #alt, #cat, #comps, def, define, dememoize, #except, #group, method_missing, #opt, #rep, #rep_n
Constructor Details
Instance Method Details
#match(s) ⇒ Object
30 31 32 |
# File 'lib/rbnf/nodes.rb', line 30 def match(s) a=~s or b=~s end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/rbnf/nodes.rb', line 23 def to_s "#{a} | #{b}" end |