Class: Obscured::Doorman::Configuration
- Inherits:
-
Object
- Object
- Obscured::Doorman::Configuration
- Defined in:
- lib/obscured-doorman/configuration.rb
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
66 67 68 69 70 71 |
# File 'lib/obscured-doorman/configuration.rb', line 66 def initialize @config_values = {} # set default attribute values @defaults = _defaults end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
64 65 66 |
# File 'lib/obscured-doorman/configuration.rb', line 64 def defaults @defaults end |
Class Method Details
.config_option(name) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/obscured-doorman/configuration.rb', line 6 def self.config_option(name) define_method(name) do read_value(name) end define_method("#{name}=") do |value| set_value(name, value) end end |
Instance Method Details
#[](key) ⇒ Object
73 74 75 |
# File 'lib/obscured-doorman/configuration.rb', line 73 def [](key) read_value(key) end |
#[]=(key, value) ⇒ Object
77 78 79 |
# File 'lib/obscured-doorman/configuration.rb', line 77 def []=(key, value) set_value(key, value) end |