Sha256: bace061280a2c969d47403326d335c2cba44168fbe6f656411d638c8e7cf7f7e

Contents?: true

Size: 540 Bytes

Versions: 3

Compression:

Stored size: 540 Bytes

Contents

module CodaDocs
  class Client
    module Docs
      def docs(options = {})
        response = self.class.get('/docs', query: options)
        response.parsed_response['items']
      end

      def doc(doc_id, options = {})
        self.class.get("/docs/#{doc_id}", query: options)
      end

      def create_doc(title = 'Untitled', source_doc = nil)
        self.class.post(
          '/docs',
          body: {
            'title' => title,
            'sourceDoc' => source_doc
          }.to_json
        )
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coda_docs-0.1.2 lib/coda_docs/client/docs.rb
coda_docs-0.1.1.1 lib/coda_docs/client/docs.rb
coda_docs-0.1.1 lib/coda_docs/client/docs.rb