Module: DigiwinDsp::Serializers::Base

Included in:
CancellationSerializer, InvoiceSerializer, ReturnSerializer, SalesOrderSerializer
Defined in:
lib/digiwin_dsp/serializers/base.rb

Overview

Mix into a serializer module via ‘extend Base`. The hosting module must define a REQUIRED_FIELDS constant (array of string field names).

Instance Method Summary collapse

Instance Method Details

#serialize(records, digi_header: nil) ⇒ Object



8
9
10
11
12
# File 'lib/digiwin_dsp/serializers/base.rb', line 8

def serialize(records, digi_header: nil)
  normalized = normalize(records)
  validate!(normalized)
  wrap(normalized, digi_header)
end