Sha256: e1e4c755ca0fce56b9bc4c55f0d88d467b9d9da597eb1958ecd1c46f6f894cef

Contents?: true

Size: 410 Bytes

Versions: 1

Compression:

Stored size: 410 Bytes

Contents

require "representable/deserializer"

module Representable
  class ObjectSerializer < ObjectDeserializer
    def call
      return @object if @object.nil?

      representable = prepare(@object)

      serialize(representable, @binding.user_options)
    end

  private
    def serialize(object, user_options)
      object.send(@binding.serialize_method, user_options.merge!({:wrap => false}))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
representable-1.7.0 lib/representable/serializer.rb