Sha256: a8a25954b3b255e165bf6b53cedd9a9644dfec631462782deab2b9c19f76104d
Contents?: true
Size: 417 Bytes
Versions: 4
Compression:
Stored size: 417 Bytes
Contents
module FunWithJsonApi class ExceptionPayloadSerializer < ::ActiveModel::Serializer attributes :id, :status, :code, :title, :detail, :source def attributes(*) # Strips all empty values and empty arrays super.select { |_k, v| v.present? } end def source { pointer: object.pointer, parameter: object.parameter }.select { |_k, v| v.present? } end end end
Version data entries
4 entries across 4 versions & 1 rubygems