Project

tuple

0.0
No commit activity in last 3 years
No release in over 3 years
Fast, binary-sortable serialization for arrays of simple Ruby types.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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:¶ ↑

sudo gem install ninjudd-tuple -s http://gems.github.com

License:¶ ↑

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