Object
The Routing table. Contains all routes for a system. Routes can be added to the table by calling Routes#add_route
Add a route to the routing table.
# File lib/journey/routes.rb, line 58 58: def add_route app, path, conditions, defaults, name = nil 59: route = Route.new(name, app, path, conditions, defaults) 60: 61: route.precedence = routes.length 62: routes << route 63: named_routes[name] = route if name 64: clear_cache! 65: route 66: end
# File lib/journey/routes.rb, line 41 41: def ast 42: return @ast if @ast 43: return if partitioned_routes.first.empty? 44: 45: asts = partitioned_routes.first.map { |r| r.ast } 46: @ast = Nodes::Or.new(asts) 47: end
# File lib/journey/routes.rb, line 31 31: def clear 32: routes.clear 33: end
# File lib/journey/routes.rb, line 27 27: def each(&block) 28: routes.each(&block) 29: end
# File lib/journey/routes.rb, line 23 23: def last 24: @routes.last 25: end
# File lib/journey/routes.rb, line 18 18: def length 19: @routes.length 20: end
# File lib/journey/routes.rb, line 35 35: def partitioned_routes 36: @partitioned_routes ||= routes.partition { |r| 37: r.path.anchored && r.ast.grep(Nodes::Symbol).all? { |n| n.default_regexp? } 38: } 39: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.