class ActionDispatch::Routing::Mapper::Scope
:nodoc:
def [](key)
def [](key) scope = find { |node| node.frame.key? key } scope && scope.frame[key] end
def action_name(name_prefix, prefix, collection_name, member_name)
def action_name(name_prefix, prefix, collection_name, member_name) case scope_level when :nested [name_prefix, prefix] when :collection [prefix, name_prefix, collection_name] when :new [prefix, :new, name_prefix, member_name] when :member [prefix, name_prefix, member_name] when :root [name_prefix, collection_name, prefix] else [name_prefix, member_name, prefix] end end
def each
def each node = self until node.equal? NULL yield node node = node.parent end end
def frame; @hash; end
def frame; @hash; end
def initialize(hash, parent = NULL, scope_level = nil)
def initialize(hash, parent = NULL, scope_level = nil) @hash = hash @parent = parent @scope_level = scope_level end
def nested?
def nested? scope_level == :nested end
def new(hash)
def new(hash) self.class.new hash, self, scope_level end
def new_level(level)
def new_level(level) self.class.new(frame, self, level) end
def null?
def null? @hash.nil? && @parent.nil? end
def options
def options OPTIONS end
def resource_method_scope?
def resource_method_scope? RESOURCE_METHOD_SCOPES.include? scope_level end
def resource_scope?
def resource_scope? RESOURCE_SCOPES.include? scope_level end
def resources?
def resources? scope_level == :resources end
def root?
def root? @parent.null? end