Class ActionController::Routing::RouteSet::NamedRouteCollection
In: vendor/rails/actionpack/lib/action_controller/routing.rb
Parent: Object

A NamedRouteCollection instance is a collection of named routes, and also maintains an anonymous module that can be used to install helpers for the named routes.

Methods

[]   []=   add   clear   clear!   each   get   install   length   names   new  

Included Modules

Enumerable

Attributes

helpers  [R] 
routes  [R] 

Public Class methods

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 972
972:         def initialize
973:           clear!
974:         end

Public Instance methods

[](name)

Alias for get

[]=(name, route)

Alias for add

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 982
982:         def add(name, route)
983:           routes[name.to_sym] = route
984:           define_named_route_methods(name, route)
985:         end
clear()

Alias for clear!

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 976
976:         def clear!
977:           @routes = {}
978:           @helpers = []
979:           @module = Module.new
980:         end

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 995
995:         def each
996:           routes.each { |name, route| yield name, route }
997:           self
998:         end

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 987
987:         def get(name)
988:           routes[name.to_sym]
989:         end

[Source]

      # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 1008
1008:         def install(dest = ActionController::Base)
1009:           dest.send :include, @module
1010:           if dest.respond_to? :helper_method
1011:             helpers.each { |name| dest.send :helper_method, name }
1012:           end
1013:         end

[Source]

      # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 1004
1004:         def length
1005:           routes.length
1006:         end

[Source]

      # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 1000
1000:         def names
1001:           routes.keys
1002:         end

[Validate]