Module: ProtoPharm::MetadataSerializers::Freshly

Defined in:
lib/proto_pharm/metadata_serializers/freshly.rb

Class Method Summary collapse

Class Method Details

.serialize(code:, app_code: nil, **kwargs) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/proto_pharm/metadata_serializers/freshly.rb', line 7

def serialize(code:, app_code: nil, **kwargs)
   = kwargs.fetch(:metadata, {})

  {
    metadata: ,
  }.tap do |hash|
    if ::Gruf.
       = Labyrinth::GrufComponents::ErrorSerializer.()

      e = ::Gruf::Error.new(code: code, app_code: app_code, metadata: )
      hash[::Gruf..to_sym] = e.serialize
    end
  end
end