Sha256: b2ae63d35dd9282cc340e12be6efac02e322c1005089c2d46cfb5d0010675232
Contents?: true
Size: 731 Bytes
Versions: 12
Compression:
Stored size: 731 Bytes
Contents
require "representable/deserializer" module Representable class ObjectSerializer < ObjectDeserializer def initialize(binding, object) super(binding) @object = object end def call # return unless @binding.typed? # FIXME: fix that in XML/YAML. return @object if @object.nil? # DISCUSS: move to Object#serialize ? representable = prepare(@object) serialize(representable, @binding.user_options) end private def serialize(object, user_options) return object unless @binding.representable? @binding.send(:evaluate_option, :serialize, object) do object.send(@binding.serialize_method, user_options.merge!({:wrap => false})) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems