Class: CodaDocs::Entities::Pages

Inherits:
Entity
  • Object
show all
Defined in:
lib/coda_docs/entities/pages.rb

Instance Method Summary collapse

Methods inherited from Entity

#connection, #initialize, #parse_response

Constructor Details

This class inherits a constructor from CodaDocs::Entities::Entity

Instance Method Details

#all(doc_id, options = nil) ⇒ Object



4
5
6
7
# File 'lib/coda_docs/entities/pages.rb', line 4

def all(doc_id, options = nil)
  response = connection.get("/docs/#{doc_id}/pages", query: options)
  parse_response(response)
end

#find(doc_id, page_id, options = nil) ⇒ Object



9
10
11
# File 'lib/coda_docs/entities/pages.rb', line 9

def find(doc_id, page_id, options = nil)
  connection.get("/docs/#{doc_id}/pages/#{page_id}", query: options)
end

#update(doc_id, page_id, options) ⇒ Object



13
14
15
16
17
18
# File 'lib/coda_docs/entities/pages.rb', line 13

def update(doc_id, page_id, options)
  connection.put(
    "/docs/#{doc_id}/pages/#{page_id}",
    body: options.to_json
  )
end