module Warden::Strategies
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/warden/strategies.rbs module Warden::Strategies def []: (Symbol label) -> untyped end
def [](label)
Experimental RBS support (using type sampling data from the type_fusion
project).
def []: (Symbol label) -> untyped
This signature was generated using 1 sample from 1 application.
Provides access to strategies by label
def [](label) _strategies[label] end
def _strategies
def _strategies @strategies ||= {} end
def add(label, strategy = nil, &block)
def add(label, strategy = nil, &block) strategy ||= Class.new(Warden::Strategies::Base) strategy.class_eval(&block) if block_given? unless strategy.method_defined?(:authenticate!) raise NoMethodError, "authenticate! is not declared in the #{label.inspect} strategy" end base = Warden::Strategies::Base unless strategy.ancestors.include?(base) raise "#{label.inspect} is not a #{base}" end _strategies[label] = strategy end
def clear!
Clears all declared.
def clear! _strategies.clear end
def update(label, &block)
def update(label, &block) strategy = _strategies[label] raise "Unknown strategy #{label.inspect}" unless strategy add(label, strategy, &block) end