Module: Readthis::Passthrough
- Defined in:
- lib/readthis/passthrough.rb
Overview
The ‘Passthrough` serializer performs no encoding on objects. It should be used when caching simple string objects when the overhead of marshalling or other serialization isn’t desired.
Class Method Summary collapse
-
.dump(value) ⇒ String
Dump an object to string, without performing any encoding on it.
-
.load(value) ⇒ String
Load an object without modifying it at all.
Class Method Details
.dump(value) ⇒ String
Dump an object to string, without performing any encoding on it.
15 16 17 18 19 20 |
# File 'lib/readthis/passthrough.rb', line 15 def self.dump(value) case value when String then value.dup else value.to_s end end |
.load(value) ⇒ String
Load an object without modifying it at all.
27 28 29 |
# File 'lib/readthis/passthrough.rb', line 27 def self.load(value) value end |