Project

cushion

0.0
No commit activity in last 3 years
No release in over 3 years
A Hash with indifferent access and CouchDB persistence layer
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

active_support
>= 0
 Project Readme

Cushion

A HashWithIndifferentAccess with a CouchDB persistence layer.

Synopsis

Using Cushion is as simple as this:

hash = Cushion.new('/db/document')
hash.load
hash[:foo] = 'bar'
hash.save

When the document's URI consists only of the database part (/db), the id will be a UUID, set by CouchDB on .save.

Cushion can also be inherited from, which will lead to the database name being taken from the inheriting classes name. Like this:

class MyCushion < Cushion; end
hash = MyCushion.new
hash.save

In this case a document URI doesn't have to be given explicitly (even though, it can be given). For the above example, the URI would be /my_cushions/<UUID set by CouchDB>.