Class: MessagePack::Factory::Pool

Inherits:
Object
  • Object
show all
Defined in:
doclib/msgpack/factory.rb

Instance Method Summary collapse

Instance Method Details

#dump(object) ⇒ String

Serialize the passed value

If it could not serialize the object, it raises NoMethodError: undefined method ‘to_msgpack’ for #<the_object>.

Parameters:

  • obj (Object)

    object to serialize

Returns:

  • (String)

    serialized object



139
140
# File 'doclib/msgpack/factory.rb', line 139

def dump(object)
end

#load(data) ⇒ Object

Deserializes an object from the string or io and returns it.

If there’re not enough data to deserialize one object, this method raises EOFError. If data format is invalid, this method raises MessagePack::MalformedFormatError. If the object nests too deeply, this method raises MessagePack::StackError.

Parameters:

Returns:

  • (Object)

    deserialized object



127
128
# File 'doclib/msgpack/factory.rb', line 127

def load(data)
end

#packer {|packer| ... } ⇒ Object

Yields a Packer from the pool, and check it back in.

The packer should no longer be held after the block has returned.

Yield Parameters:



161
162
# File 'doclib/msgpack/factory.rb', line 161

def packer(&block)
end

#unpacker {|unpacker| ... } ⇒ Object

Yields an Unpacker from the pool, and check it back in.

The unpacker should no longer be held after the block has returned.

Yield Parameters:



150
151
# File 'doclib/msgpack/factory.rb', line 150

def unpacker(&block)
end