module DocumentCloud::API::Update

Constants

DOCUMENT_PATH

Public Instance Methods

update(id, options={}) click to toggle source

Update a document

@see www.documentcloud.org/help/api @param id [String] The document id @param options [Hash] Customizable set of options @param options [String] :title The document's cannonical title @param options [String] :source The source who produced the document @param options [String] :description A paragraph of detailed description @param options [String] :related_article The URL of the article associated with the document @param options [String] :published_url The URL of the page on which the document will be embedded @param options [String] :access One of 'public', 'private', 'organization', defaults to 'private' @param options [Hash] :data A hash of arbitrary key/value data pairs @returns [DocumentCloud::Document] The document uploaded

# File lib/document_cloud/api/update.rb, line 20
def update(id, options={})
  build_object DocumentCloud::Document, put(document_path(id), options)
end

Private Instance Methods

document_path(document_id) click to toggle source
# File lib/document_cloud/api/update.rb, line 26
def document_path(document_id)
  "#{DOCUMENT_PATH}/#{document_id.to_i}.json"
end