123456789_123456789_123456789_123456789_123456789_

Class: ActionDispatch::Journey::Visitors::FormatBuilder

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Visitor
Instance Chain:
self, Visitor
Inherits: ActionDispatch::Journey::Visitors::Visitor
Defined in: actionpack/lib/action_dispatch/journey/visitors.rb

Constant Summary

Visitor - Inherited

DISPATCH_CACHE

Instance Method Summary

Instance Method Details

#accept(node)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 137

def accept(node); Journey::Format.new(super); end

#binary(node)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 140

def binary(node)
  visit(node.left) + visit(node.right)
end

#terminal(node)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 138

def terminal(node); [node.left]; end

#visit_GROUP(n)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 144

def visit_GROUP(n); [Journey::Format.new(unary(n))]; end

#visit_STAR(n)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 146

def visit_STAR(n)
  [Journey::Format.required_path(n.left.to_sym)]
end

#visit_SYMBOL(n)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 150

def visit_SYMBOL(n)
  symbol = n.to_sym
  if symbol == :controller
    [Journey::Format.required_path(symbol)]
  else
    [Journey::Format.required_segment(symbol)]
  end
end