Class: GOM::Storage::CouchDB::Saver

Inherits:
Object
  • Object
show all
Defined in:
lib/gom/storage/couchdb/saver.rb

Overview

Saves the given draft to a CouchDB document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(database, draft, revisions, storage_name) ⇒ Saver

Returns a new instance of Saver.



7
8
9
# File 'lib/gom/storage/couchdb/saver.rb', line 7

def initialize(database, draft, revisions, storage_name)
  @database, @draft, @revisions, @storage_name = database, draft, revisions, storage_name
end

Instance Attribute Details

#object_idObject (readonly)

Returns the value of attribute object_id.



5
6
7
# File 'lib/gom/storage/couchdb/saver.rb', line 5

def object_id
  @object_id
end

Instance Method Details

#performObject



11
12
13
14
15
16
17
# File 'lib/gom/storage/couchdb/saver.rb', line 11

def perform
  initialize_document
  set_properties
  set_relations
  save_document
  store_revision
end