Module: Unpickle

Defined in:
lib/unpickle.rb

Overview

Library to handle a limited subset of python objects picked using protocol 0.

Author

Chris Collins ([email protected])

Copyright

Copyright © 2012 Chris Collins, Anchor Systems Pty Ltd

Defined Under Namespace

Classes: Mark, PickleMachine, UnpickleException

Class Method Summary collapse

Class Method Details

.loads(str) ⇒ Object

Unpickle the python object pickled into str.

At this time, this ONLY works with a limited set of constructs (dicts, lists, tuples, strings, ints, bools, None) and only with protocol 0.

Raises an UnpickleException if anything goes wrong.



209
210
211
212
# File 'lib/unpickle.rb', line 209

def Unpickle.loads(str)
    p = Unpickle::PickleMachine.new(str)
    return p.unpickle
end