Scope、Mapping、Constraints

包含:Scope、Mapping、Constraints

Scope

@scope 是其实例对象。

module ActionDispatch
  module Routing
    class Mapper
      def initialize(set)
        @set = set
        @scope = Scope.new({ :path_names => @set.resources_path_names })
        @concerns = {}
        @nesting = []
      end
    end
  end
end

Mapping

标准化路由规则。

match 会调用 add_route,进而 @set.add_route 完成添加路由规则。但在 @set.add_route 之前,要先把路由规则标准化。

Constraints

标准化路由规则这个过程中,涉及到的一个对象。

Endpoint 的子类之一,它是 endpoint.

最后更新于

这有帮助吗?