Sha256: d3e13d33bbb2d65170299d63653359ec4759ad342f45e43360bd97f8d450b316

Contents?: true

Size: 933 Bytes

Versions: 15

Compression:

Stored size: 933 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)
        SoberSwag::Serializer::Primitive.new(contained)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sober_swag-0.20.0 lib/sober_swag/serializer.rb
sober_swag-0.19.0 lib/sober_swag/serializer.rb
sober_swag-0.18.0 lib/sober_swag/serializer.rb
sober_swag-0.17.0 lib/sober_swag/serializer.rb
sober_swag-0.16.0 lib/sober_swag/serializer.rb
sober_swag-0.15.0 lib/sober_swag/serializer.rb
sober_swag-0.14.0 lib/sober_swag/serializer.rb
sober_swag-0.13.0 lib/sober_swag/serializer.rb
sober_swag-0.12.0 lib/sober_swag/serializer.rb
sober_swag-0.11.0 lib/sober_swag/serializer.rb
sober_swag-0.10.0 lib/sober_swag/serializer.rb
sober_swag-0.9.0 lib/sober_swag/serializer.rb
sober_swag-0.8.0 lib/sober_swag/serializer.rb
sober_swag-0.7.0 lib/sober_swag/serializer.rb
sober_swag-0.6.0 lib/sober_swag/serializer.rb