123456789_123456789_123456789_123456789_123456789_

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:
Instance Chain:
Inherits: ActionDispatch::Journey::Visitors::FunctionalVisitor
Defined in: actionpack/lib/action_dispatch/journey/visitors.rb

Constant Summary

FunctionalVisitor - Inherited

DISPATCH_CACHE

Instance Method Summary

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