Class: Dsu::Services::Configuration::HydratorService

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

Instance Method Summary collapse

Constructor Details

#initialize(config_hash:, options: {}) ⇒ HydratorService

Returns a new instance of HydratorService.

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dsu/services/configuration/hydrator_service.rb', line 10

def initialize(config_hash:, options: {})
  raise ArgumentError, 'config_hash is nil' if config_hash.nil?

  unless config_hash.is_a?(Hash)
    raise ArgumentError,
      "config_hash is the wrong object type: \"#{config_hash}\""
  end
  raise ArgumentError, 'options is nil' if options.nil?
  raise ArgumentError, "options is the wrong object type:\"#{options}\"" unless options.is_a?(Hash)

  @config_hash = config_hash.dup
  @options = options || {}
end

Instance Method Details

#callObject



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

def call
  hydrate
end