Class: ROM::CouchDB::Commands::Create

Inherits:
ROM::Commands::Create
  • Object
show all
Defined in:
lib/rom/couchdb/commands.rb

Overview

CouchDB create command

Instance Method Summary collapse

Instance Method Details

#collectionObject



8
9
10
# File 'lib/rom/couchdb/commands.rb', line 8

def collection
  relation.dataset
end

#execute(object) ⇒ Object



12
13
14
15
16
# File 'lib/rom/couchdb/commands.rb', line 12

def execute(object)
  document = object.dup
  collection << document
  [document]
end