Class: Cuprum::Rails::Serializers::Json::IdentitySerializer

Inherits:
BaseSerializer
  • Object
show all
Defined in:
lib/cuprum/rails/serializers/json/identity_serializer.rb

Overview

Serializer that returns a value object as itself.

Instance Method Summary collapse

Methods inherited from BaseSerializer

instance

Instance Method Details

#call(object, **_) ⇒ Object

Returns the object.

This serializer should only be used with value objects: nil, true, false, Integers, Floats, and Strings.

Parameters:

  • object (Object)

    The object to convert to JSON.

Returns:

  • (Object)

    a JSON representation of the object.



17
18
19
# File 'lib/cuprum/rails/serializers/json/identity_serializer.rb', line 17

def call(object, **_)
  object
end