Class: Representable::Serializer

Inherits:
Deserializer show all
Defined in:
lib/representable/serializer.rb

Overview

serialize -> serialize! -> marshal. # TODO: same flow in deserialize.

Direct Known Subclasses

Collection, Hash

Defined Under Namespace

Classes: Collection, Hash

Instance Method Summary collapse

Methods inherited from Deserializer

#initialize

Constructor Details

This class inherits a constructor from Representable::Deserializer

Instance Method Details

#call(object, &block) ⇒ Object



6
7
8
9
10
# File 'lib/representable/serializer.rb', line 6

def call(object, &block)
  return object if object.nil? # DISCUSS: move to Object#serialize ?

  serialize(object, @binding.user_options, &block)
end