Module: Configuration
- Included in:
- Faceauth
- Defined in:
- lib/faceauth/configuration.rb
Instance Method Summary collapse
-
#configuration {|_self| ... } ⇒ Object
Initializing the configuration module.
-
#define_setting(name, default = nil) ⇒ Object
Method to define configuration variables & assign default values or values provied.
Instance Method Details
#configuration {|_self| ... } ⇒ Object
Initializing the configuration module
4 5 6 |
# File 'lib/faceauth/configuration.rb', line 4 def configuration yield self end |
#define_setting(name, default = nil) ⇒ Object
Method to define configuration variables & assign default values or values provied.
9 10 11 12 13 14 15 16 17 |
# File 'lib/faceauth/configuration.rb', line 9 def define_setting(name, default = nil) class_variable_set("@@#{name}", default) define_class_method "#{name}=" do |value| class_variable_set("@@#{name}", value) end define_class_method name do class_variable_get("@@#{name}") end end |