Class: ActionDispatch::Journey::Visitors::String
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
FunctionalVisitor
|
|
Instance Chain:
self,
FunctionalVisitor
|
|
Inherits: |
ActionDispatch::Journey::Visitors::FunctionalVisitor
|
Defined in: | actionpack/lib/action_dispatch/journey/visitors.rb |
Constant Summary
FunctionalVisitor
- Inherited
Instance Method Summary
- #binary(node, seed) private
- #nary(node, seed) private
- #terminal(node, seed) private
- #visit_GROUP(node, seed) private
FunctionalVisitor
- Inherited
Instance Method Details
#binary(node, seed) (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 172
def binary(node, seed) visit(node.right, visit(node.left, seed)) end
#nary(node, seed) (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 176
def nary(node, seed) last_child = node.children.last node.children.inject(seed) { |s, c| string = visit(c, s) string << "|" unless last_child == c string } end
#terminal(node, seed) (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 185
def terminal(node, seed) seed + node.left end
#visit_GROUP(node, seed) (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 189
def visit_GROUP(node, seed) visit(node.left, seed.dup << "(") << ")" end