Class: Dsu::Services::EntryGroup::HydratorService

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of HydratorService.

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
# File 'lib/dsu/services/entry_group/hydrator_service.rb', line 10

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

  @entry_group_hash = entry_group_hash
  @options = options || {}
end

Instance Method Details

#callObject



18
19
20
# File 'lib/dsu/services/entry_group/hydrator_service.rb', line 18

def call
  Models::EntryGroup.new(**hydrate)
end