Sha256: 070e0621e64066100ab4adf6268072c966d34f55820954deebb1f7566209355d
Contents?: true
Size: 612 Bytes
Versions: 12
Compression:
Stored size: 612 Bytes
Contents
module SoberSwag module Serializer ## # A new serializer by mapping over the serialization function class Mapped < Base def initialize(base, map_f) @base = base @map_f = map_f end attr_reader :base, :map_f def serialize(object, options = {}) @base.serialize(@map_f.call(object), options) end def lazy_type? @base.lazy_type? end def lazy_type @base.lazy_type end def finalize_lazy_type! @base.finalize_lazy_type! end def type @base.type end end end end
Version data entries
12 entries across 12 versions & 1 rubygems