class ActionDispatch::Journey::Routes
:nodoc:
added to the table by calling Routes#add_route.
The Routing table. Contains all routes for a system. Routes can be
:nodoc:
def add_route(name, mapping)
def add_route(name, mapping) route = mapping.make_route name, routes.length routes << route partition_route(route) clear_cache! route end
def ast
def ast @ast ||= begin nodes = anchored_routes.map(&:ast) Nodes::Or.new(nodes) end end
def clear
def clear routes.clear anchored_routes.clear custom_routes.clear end
def clear_cache!
def clear_cache! @ast = nil @simulator = nil end
def each(&block)
def each(&block) routes.each(&block) end
def empty?
def empty? routes.empty? end
def initialize(routes = [])
def initialize(routes = []) @routes = routes @ast = nil @anchored_routes = [] @custom_routes = [] @simulator = nil end
def last
def last routes.last end
def length
def length routes.length end
def partition_route(route)
def partition_route(route) if route.path.anchored && route.path.requirements_anchored? anchored_routes << route else custom_routes << route end end
def simulator
def simulator @simulator ||= begin gtg = GTG::Builder.new(ast).transition_table GTG::Simulator.new(gtg) end end