Class: SecretConfig::Config
- Inherits:
-
Object
- Object
- SecretConfig::Config
- Extended by:
- Forwardable
- Defined in:
- lib/secret_config/config.rb
Instance Method Summary collapse
- #[](sub_path) ⇒ Object
- #[]=(sub_path, value) ⇒ Object
- #delete(sub_path) ⇒ Object
- #fetch(sub_path, **options) ⇒ Object
-
#initialize(path, registry) ⇒ Config
constructor
A new instance of Config.
- #key?(sub_path) ⇒ Boolean
- #set(sub_path, value) ⇒ Object
Constructor Details
#initialize(path, registry) ⇒ Config
Returns a new instance of Config.
7 8 9 10 |
# File 'lib/secret_config/config.rb', line 7 def initialize(path, registry) @path = path @registry = registry end |
Instance Method Details
#[](sub_path) ⇒ Object
16 17 18 |
# File 'lib/secret_config/config.rb', line 16 def [](sub_path) registry[join_path(sub_path)] end |
#[]=(sub_path, value) ⇒ Object
20 21 22 |
# File 'lib/secret_config/config.rb', line 20 def []=(sub_path, value) registry[join_path(sub_path)] = value end |
#delete(sub_path) ⇒ Object
32 33 34 |
# File 'lib/secret_config/config.rb', line 32 def delete(sub_path) registry.delete(join_path(sub_path)) end |
#fetch(sub_path, **options) ⇒ Object
12 13 14 |
# File 'lib/secret_config/config.rb', line 12 def fetch(sub_path, **) registry.fetch(join_path(sub_path), **) end |
#key?(sub_path) ⇒ Boolean
24 25 26 |
# File 'lib/secret_config/config.rb', line 24 def key?(sub_path) registry.key?(join_path(sub_path)) end |
#set(sub_path, value) ⇒ Object
28 29 30 |
# File 'lib/secret_config/config.rb', line 28 def set(sub_path, value) registry.set(join_path(sub_path), value) end |