Parent

Class/Module Index [+]

Quicksearch

Ruote::Serializer

To get a YAML serializer :

serializer = Serializer.new(:yaml)

A marshal + base64 one :

serializer = Serializer.new(:marshal64)

A marshal only one :

serializer = Serializer.new(:marshal)

For the rest, it's the classical :

data = serializer.encode(object)

object = serializer.decode(data)

Constants

FLAVOURS

The flavour map

MARSHAL

plain marshal serialization

MARSHAL64

marshal serialization with base64 encoding

YAML

YAML serialization

Public Class Methods

new(flavour) click to toggle source
# File lib/ruote/util/serializer.rb, line 85
def initialize (flavour)

  @flavour = FLAVOURS[flavour] || MARSHAL64

  @flavour[0].call # initializes the flavour
end

Public Instance Methods

decode(s) click to toggle source
# File lib/ruote/util/serializer.rb, line 97
def decode (s)

  @flavour[2].call(s)
end
encode(o) click to toggle source
# File lib/ruote/util/serializer.rb, line 92
def encode (o)

  @flavour[1].call(o)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.