Module CouchRest::Attributes
In: lib/couchrest/attributes.rb

Methods

[]   []=   _attributes   as_couch_json   clone   delete   dup   freeze   has_key?   inspect   new   to_hash  

Public Class methods

Initialize a new CouchRest Document and prepare a hidden attributes hash.

When inherting a Document, it is essential that the super method is called before you own changes to ensure that the attributes hash has been initialized before you attempt to use it.

Public Instance methods

Provide JSON data hash that can be stored in the database. Will go through each attribute value and request the `as_couch_json` method on each if available, or return the value as-is.

Freeze the object‘s attributes instead of the actual document. This prevents further modifications to stored data, but does allow access to local variables useful for callbacks or cached data.

Provide details of the current keys in the reponse. Based on ActiveRecord::Base.

Protected Instance methods

Define accessor for _attributes hash that will instantiate the model if this has not already been done.

[Validate]