Class: SecretConfig::Config

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/secret_config/config.rb

Instance Method Summary collapse

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, **options)
  registry.fetch(join_path(sub_path), **options)
end

#key?(sub_path) ⇒ Boolean

Returns:

  • (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