Sha256: e7e4fec6b6d52517c13bf1e57536841283b2858d8a50f8075af6881f54cd5c01
Contents?: true
Size: 538 Bytes
Versions: 11
Compression:
Stored size: 538 Bytes
Contents
# frozen_string_literal: true module StoreModel module Types # Implements #encode_json and #as_json methods. # By wrapping serialized objects in this type, it prevents duplicate # JSON serialization passes on nested object. It is named as Encoder # as it will not work to inflate typed attributes and is intended # to be used internally. class RawJSONEncoder < String def encode_json(_encoder) self end def as_json(_options = nil) JSON.parse(self) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems