class Rodauth::Configuration
Attributes
Public Class Methods
Source
# File lib/rodauth.rb 331 def initialize(auth, &block) 332 @auth = auth 333 # :nocov: 334 # Only for backwards compatibility 335 # RODAUTH3: Remove 336 apply(&block) if block 337 # :nocov: 338 end
Public Instance Methods
Source
# File lib/rodauth.rb 340 def apply(&block) 341 load_feature(:base) 342 instance_exec(&block) 343 end
Source
# File lib/rodauth.rb 345 def enable(*features) 346 features.each do |feature| 347 next if @auth.features.include?(feature) 348 load_feature(feature) 349 @auth.features << feature 350 end 351 end
Private Instance Methods
Source
# File lib/rodauth.rb 355 def load_feature(feature_name) 356 require "rodauth/features/#{feature_name}" unless FEATURES[feature_name] 357 feature = FEATURES[feature_name] 358 enable(*feature.dependencies) 359 extend feature.configuration 360 361 @auth.routes.concat(feature.routes) 362 @auth.send(:include, feature) 363 end