module AuthStrategist class Configuration attr_accessor :default_strategy_components, :strategies_path def initialize @default_strategy_components = [] @strategies = strategies_registry_class.new end def strategies return @strategies unless block_given? load_strategies yield(@strategies) end private def load_strategies Dir["./#{strategies_path}/*.rb"].each { |file| require file } if strategies_path end def strategies_registry_class self.class::StrategiesRegistry end end end