Class: Moneta::Transforms::ToS

Inherits:
Moneta::Transform show all
Defined in:
lib/moneta/transforms/tos.rb

Overview

Serializes objects to strings by calling their #to_s method. This method is implemented on all(?) objects, but with wildly different results!

Instance Method Summary collapse

Methods inherited from Moneta::Transform

#decodable?, #decode, delegate_to, #initialize, #method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from Moneta::Transform

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Moneta::Transform

Instance Method Details

#encode(value) ⇒ String

Parameters:

  • value (Object)

Returns:

  • (String)


9
10
11
# File 'lib/moneta/transforms/tos.rb', line 9

def encode(value)
  value.to_s
end