Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fast, binary-sortable serialization for arrays of simple Ruby types.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 ext
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 tuple.gemspec
README.rdoc

Tuple

Tuple provides fast, binary-sortable serialization for arrays of simple Ruby types. This means you do not have to deserialize your tuples to store them. This leads to significant performance benifits when using Tuples as keys for a BTree.

A Tuple is just an Array of any number of simple Ruby types. The following types are supported (listed in ascending sort order):

  1. NilClass

  2. FalseClass

  3. Integer (Fixnum or Bignum)

  4. String

  5. Symbol

  6. True

Usage:

require 'tuple'

data = Tuple.dump([1, -43, :foo, "bar", true, false, nil])
=> "\000\000\020\000\000\000\000\001..."
Tuple.load(data)
=> [1, -43, :foo, "bar", true, false, nil]

Install:

gem install tuple

License:

Copyright © 2009 Justin Balthrop; Published under The MIT License, see LICENSE

Something went wrong with that request. Please try again.