Class: JsonRpcObjects::Serializer::YAML

Inherits:
JsonRpcObjects::Serializer show all
Defined in:
lib/json-rpc-objects/serializer/yaml.rb

Overview

YAML serializer using internal Ruby YAML.

Instance Method Summary collapse

Instance Method Details

#deserialize(data) ⇒ Object

Deserializes data.

Parameters:

  • data (Object)

    data in serialized form

Returns:

  • (Object)

    deserialized data



44
45
46
# File 'lib/json-rpc-objects/serializer/yaml.rb', line 44

def deserialize(data)
    ::YAML.load(data)
end

#serialize(data) ⇒ Object

Serializes data.

Parameters:

  • data (Object)

    some data

Returns:

  • (Object)

    object in serialized form



33
34
35
# File 'lib/json-rpc-objects/serializer/yaml.rb', line 33

def serialize(data)
    ::YAML.dump(data)
end