Sha256: 5a643edfa08ac6dc7b0bb53f60b9bb46482e7672ec664eb03185d91fa2519886
Contents?: true
Size: 656 Bytes
Versions: 3
Compression:
Stored size: 656 Bytes
Contents
module Authlogic module Config def self.extended(klass) klass.class_eval do class_attribute :acts_as_authentic_config self.acts_as_authentic_config ||= {} end end private # This is a one-liner method to write a config setting, read the config # setting, and also set a default value for the setting. 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 end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
authlogic-4.3.0 | lib/authlogic/config.rb |
authlogic-4.2.0 | lib/authlogic/config.rb |
authlogic-4.1.1 | lib/authlogic/config.rb |