Class: Dsu::Services::MigrationVersion::HydratorService

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of HydratorService.

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/dsu/services/migration_version/hydrator_service.rb', line 7

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

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

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

Instance Method Details

#callObject



21
22
23
# File 'lib/dsu/services/migration_version/hydrator_service.rb', line 21

def call
  hydrate
end