class SoberSwag::Serializer::Primitive

A class that does no serialization: you give it a type, and it will pass any serialized input on verbatim.

Attributes

type[R]

Public Class Methods

new(type) click to toggle source

Construct a primitive serializer with a description of the type it serializes to. @param type [Class] a swagger-able type

# File lib/sober_swag/serializer/primitive.rb, line 10
def initialize(type)
  @type = type
end

Public Instance Methods

serialize(object, _options = {}) click to toggle source
# File lib/sober_swag/serializer/primitive.rb, line 16
def serialize(object, _options = {})
  object
end