Class: Rodauth::Configuration
- Inherits:
-
Object
- Object
- Rodauth::Configuration
- Defined in:
- lib/rodauth.rb
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
Instance Method Summary collapse
- #apply(&block) ⇒ Object
- #enable(*features) ⇒ Object
-
#initialize(auth, &block) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(auth, &block) ⇒ Configuration
Returns a new instance of Configuration.
331 332 333 334 335 336 337 338 |
# File 'lib/rodauth.rb', line 331 def initialize(auth, &block) @auth = auth # :nocov: # Only for backwards compatibility # RODAUTH3: Remove apply(&block) if block # :nocov: end |
Instance Attribute Details
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
329 330 331 |
# File 'lib/rodauth.rb', line 329 def auth @auth end |
Instance Method Details
#apply(&block) ⇒ Object
340 341 342 343 |
# File 'lib/rodauth.rb', line 340 def apply(&block) load_feature(:base) instance_exec(&block) end |
#enable(*features) ⇒ Object
345 346 347 348 349 350 351 |
# File 'lib/rodauth.rb', line 345 def enable(*features) features.each do |feature| next if @auth.features.include?(feature) load_feature(feature) @auth.features << feature end end |