Sha256: 469480c3f4b1fe0166fc3ec202d34ae62af2c842f8edcb3898c3be2314a9bb71

Contents?: true

Size: 509 Bytes

Versions: 9

Compression:

Stored size: 509 Bytes

Contents

module SoberSwag
  module Serializer
    ##
    # A class that does *no* serialization: you give it a type,
    # and it will pass any serialized input on verbatim.
    class Primitive < Base
      ##
      # Construct a primitive serializer with a description of the type it serializes to.
      # @param type [Class] a swagger-able type
      def initialize(type)
        @type = type
      end

      attr_reader :type

      def serialize(object, _options = {})
        object
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sober_swag-0.25.2 lib/sober_swag/serializer/primitive.rb
sober_swag-0.25.1 lib/sober_swag/serializer/primitive.rb
sober_swag-0.25.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.24.1 lib/sober_swag/serializer/primitive.rb
sober_swag-0.24.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.23.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.22.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.21.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.20.0 lib/sober_swag/serializer/primitive.rb