Sha256: f67d34a3255f27ccf1cf75643a4bb603223353c7d57ad420eb773bcfb0103dc1

Contents?: true

Size: 969 Bytes

Versions: 4

Compression:

Stored size: 969 Bytes

Contents

module SoberSwag
  ##
  # Container module for serializers.
  # The interface for these is described in {SoberSwag::Serializer::Base}.
  module Serializer
    autoload(:Base, 'sober_swag/serializer/base')
    autoload(:Primitive, 'sober_swag/serializer/primitive')
    autoload(:Conditional, 'sober_swag/serializer/conditional')
    autoload(:Array, 'sober_swag/serializer/array')
    autoload(:Mapped, 'sober_swag/serializer/mapped')
    autoload(:Optional, 'sober_swag/serializer/optional')
    autoload(:FieldList, 'sober_swag/serializer/field_list')
    autoload(:Meta, 'sober_swag/serializer/meta')

    class << self
      ##
      # Use a "Primitive" serializer, which *does not* actually do any type-changing, and instead passes
      # in values raw.
      #
      # @param contained {Class} Dry::Type to use
      def Primitive(contained) # rubocop:disable Naming/MethodName
        SoberSwag::Serializer::Primitive.new(contained)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sober_swag-0.5.0 lib/sober_swag/serializer.rb
sober_swag-0.4.0 lib/sober_swag/serializer.rb
sober_swag-0.3.0 lib/sober_swag/serializer.rb
sober_swag-0.2.0 lib/sober_swag/serializer.rb