Class: Michael::Services::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/michael/services/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Configuration

Returns a new instance of Configuration.

Raises:



10
11
12
13
14
# File 'lib/michael/services/configuration.rb', line 10

def initialize(config)
  raise Error, 'configuration is not initialized' if config.nil?

  @config = config
end

Instance Method Details

#append(*values, to: nil) ⇒ Object



20
21
22
# File 'lib/michael/services/configuration.rb', line 20

def append(*values, to: nil)
  interact(:append, *values, to: to)
end

#fetch(*keys, default: nil) ⇒ Object



24
25
26
# File 'lib/michael/services/configuration.rb', line 24

def fetch(*keys, default: nil)
  interact(:fetch, *keys, default: default)
end

#remove(*values, from: nil) ⇒ Object



28
29
30
# File 'lib/michael/services/configuration.rb', line 28

def remove(*values, from: nil)
  interact(:remove, *values, from: from)
end

#set(*keys, value: nil) ⇒ Object



16
17
18
# File 'lib/michael/services/configuration.rb', line 16

def set(*keys, value: nil)
  interact(:set, *keys, value: value)
end