Sha256: 5c876c1fb450f19348903f22139658e7d0cdefe2b2d46559f989566df1860a1e
Contents?: true
Size: 774 Bytes
Versions: 14
Compression:
Stored size: 774 Bytes
Contents
# frozen_string_literal: true require 'json' require 'pi_resources/serializer/base' module PiResources module Serializer class ValidationResponseSerializer include Base attr_reader :message def initialize(resource, message = nil) @resource = resource @message = message end protected def validation_response @resource.attributes.symbolize_keys.deep_transform_keys do |k| run_key_transform!(k) end end def serializable_hash! result = {} result[run_key_transform!(:validation_response)] = validation_response result[run_key_transform!(:message)] = message if message result end end end end
Version data entries
14 entries across 14 versions & 1 rubygems