Sha256: 25ece8786734f1f9368e1a3fc47c6fe83578696a4b34e12762c77c26f7d5bed8

Contents?: true

Size: 379 Bytes

Versions: 1

Compression:

Stored size: 379 Bytes

Contents

class CouchConsole
  def init
    puts "** initialize create"
    @commands << {
      :regexp => /^\s*new_doc\s*$/,
      :method => :new_doc,
      :documentation => [["new_doc", "Create a new document"]]
    }
  end
  
  def new_doc
    document = CouchRest::Document.new
    document.database = @db
    document.save
    puts "** Document `#{document.id}' created!"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couchc-0.1.0 lib/commands/new_doc.rb