Sha256: 41e1873e18a274886a92e30053777b6f48c5aea70a4690cc51aee0429ac92fe8
Contents?: true
Size: 676 Bytes
Versions: 3
Compression:
Stored size: 676 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.1.0 | lib/authlogic/config.rb |
authlogic-4.0.1 | lib/authlogic/config.rb |
authlogic-4.0.0 | lib/authlogic/config.rb |