Sha256: 86f5223d5aa0dc4d194d7f336498877d47d5dd5577a9a8d323f19917cf9e65a1

Contents?: true

Size: 362 Bytes

Versions: 18

Compression:

Stored size: 362 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
      def initialize(type)
        @type = type
      end

      attr_reader :type

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
sober_swag-0.19.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.18.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.17.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.16.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.15.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.14.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.13.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.12.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.11.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.10.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.9.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.8.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.7.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.6.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.5.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.4.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.3.0 lib/sober_swag/serializer/primitive.rb
sober_swag-0.2.0 lib/sober_swag/serializer/primitive.rb