Class: Reconfig::Namespace
- Inherits:
-
Object
- Object
- Reconfig::Namespace
- Defined in:
- lib/reconfig/namespace.rb
Instance Attribute Summary collapse
-
#meta_key ⇒ Object
Returns the value of attribute meta_key.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #config ⇒ Object
-
#initialize(meta_key, opts = {}) ⇒ Namespace
constructor
A new instance of Namespace.
- #refresh ⇒ Object
Constructor Details
#initialize(meta_key, opts = {}) ⇒ Namespace
Returns a new instance of Namespace.
6 7 8 9 10 11 |
# File 'lib/reconfig/namespace.rb', line 6 def initialize(, opts={}) @meta_key = @options = { prefix: + ':' }.merge opts end |
Instance Attribute Details
#meta_key ⇒ Object
Returns the value of attribute meta_key.
4 5 6 |
# File 'lib/reconfig/namespace.rb', line 4 def @meta_key end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/reconfig/namespace.rb', line 4 def @options end |
Instance Method Details
#[](key) ⇒ Object
22 23 24 |
# File 'lib/reconfig/namespace.rb', line 22 def [](key) config[key] end |
#[]=(key, value) ⇒ Object
26 27 28 29 |
# File 'lib/reconfig/namespace.rb', line 26 def []=(key, value) set(key, value) config[key] = value end |
#config ⇒ Object
13 14 15 |
# File 'lib/reconfig/namespace.rb', line 13 def config @config ||= refresh_config end |
#refresh ⇒ Object
17 18 19 20 |
# File 'lib/reconfig/namespace.rb', line 17 def refresh refresh_keyspace refresh_config end |