module Authlogic::Config
Mixed into ‘Authlogic::ActsAsAuthentic::Base` and `Authlogic::Session::Base`.
Constants
- E_USE_NORMAL_RAILS_VALIDATION
Public Class Methods
Source
# File lib/authlogic/config.rb, line 13 def self.extended(klass) klass.class_eval do # TODO: Is this a confusing name, given this module is mixed into # both `Authlogic::ActsAsAuthentic::Base` and # `Authlogic::Session::Base`? Perhaps a more generic name, like # `authlogic_config` would be better? class_attribute :acts_as_authentic_config self.acts_as_authentic_config ||= {} end end
Private Instance Methods
Source
# File lib/authlogic/config.rb, line 26 def deprecate_authlogic_config(method_name) ::ActiveSupport::Deprecation.new.warn( format(E_USE_NORMAL_RAILS_VALIDATION, method_name) ) end
Source
# File lib/authlogic/config.rb, line 34 def rw_config(key, value, default_value = nil) if value.nil? acts_as_authentic_config.include?(key) ? acts_as_authentic_config[key] : default_value else self.acts_as_authentic_config = acts_as_authentic_config.merge(key => value) value end end
This is a one-liner method to write a config setting, read the config setting, and also set a default value for the setting.