Class: BloodContracts::Storages::Serializer

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/blood_contracts/storages/serializer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(*args) ⇒ Object



8
9
10
# File 'lib/blood_contracts/storages/serializer.rb', line 8

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



12
13
14
15
16
17
# File 'lib/blood_contracts/storages/serializer.rb', line 12

def call
  return object_serializer_to_hash if object_serializer?
  return serializer.to_hash if hash_serializer?

  raise "Both #dump and #load methods should be defined for serialization"
end