class ActionDispatch::Routing::Mapper::Scope
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/action_dispatch/routing/mapper.rbs class ActionDispatch::Routing::Mapper::Scope def []: (Symbol key) -> nil def action_name: (nil name_prefix, String prefix, nil collection_name, nil member_name) -> untyped def each: () -> nil def frame: () -> untyped def initialize: (Hash hash, ?ActionDispatch::Routing::Mapper::Scope parent, ?Symbol scope_level) -> void end
:nodoc:
def [](key)
Experimental RBS support (using type sampling data from the type_fusion
project).
def []: (Symbol key) -> nil
This signature was generated using 10 samples from 1 application.
def [](key) scope = find { |node| node.frame.key? key } scope && scope.frame[key] end
def action_name(name_prefix, prefix, collection_name, member_name)
Experimental RBS support (using type sampling data from the type_fusion
project).
def action_name: (nil name_prefix, String prefix, nil collection_name, nil member_name) -> untyped
This signature was generated using 1 sample from 1 application.
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
Experimental RBS support (using type sampling data from the type_fusion
project).
def each: () -> nil
This signature was generated using 9 samples from 1 application.
def each node = self until node.equal? NULL yield node node = node.parent end end
def frame; @hash; end
Experimental RBS support (using type sampling data from the type_fusion
project).
def frame: () -> untyped
This signature was generated using 27 samples from 1 application.
def frame; @hash; end
def initialize(hash, parent = NULL, scope_level = nil)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (controller | String hash, ?ActionDispatch::Routing::Mapper::Scope parent, ?Symbol scope_level) -> void
This signature was generated using 1 sample from 1 application.
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