Class CouchObject::Document
In: lib/couch_object/document.rb
Parent: Object
Enumerable Document StandardError HasManyAssociationError MissingView CantCompareSize DocumentNotFound BelongsToAssociationError HasOneAssociationError CouchDBError MapProcessError DatabaseSaveFailed NoDatabaseLocationSet Array HasManyRelation Response Database Server View Errors VERSION ClassMethods Persistable Utils CouchObject dot/f_3.png

Represents a CouchDb document

Methods

[]   []=   create   each   has_key?   id=   new   new?   respond_to?   save   to_json   update  

Included Modules

Enumerable

Attributes

attributes  [RW] 
id  [RW] 
revision  [RW] 

Public Class methods

initializes a new document object with attributes as the document values

Public Instance methods

Look up an attribute by key

Set an attributes by key to value

yields each document attribute

is the attribute key in this document?

Sets the id to new_id (Only for internal use really, but public nevertheless)

is this a new document?

is the attribute key in this document?

Saves this document to the database

Converts the Document to a JSON representation of its attributes

Protected Instance methods

[Validate]