coda_docs 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f25ef6a3dec7c0311fb93b8cb649a738eaa8fdefdffae63b8a136eb38e39cb1c
4
- data.tar.gz: 7105c6735b893187c86f1b27e4e08a6e774bc71ac3d6418658197035154aeda5
3
+ metadata.gz: b6c86d0f9b3f01c8d4c676832e3d3184f0d5574beb7718d58a2a8fd92f8226ac
4
+ data.tar.gz: 6df83a22d5323097e7403af15b54105cd9823e8e69ffd9476ecc1a6456ee4f62
5
5
  SHA512:
6
- metadata.gz: e1415c38663db9aa59ae81832c5d9e068e92bbeee2bf08b99b1611f2c61de06e7394f47f9f6bdfe28d591cad48c16beec0b7ee64cde3a42e49f1f277de8e51ab
7
- data.tar.gz: d976ac1a630f436d52900380b11f631fcf92c2832910db39dd7ababb755e581c0908627021305eeaacd847e22c8768545d3beb0b89d96913602ce4f82bb804a0
6
+ metadata.gz: e50493d68a522e10bbe4b59ed0333506ae25dc81d4548bc842a97a1ac9b4de7900bc0701d7d03985ad13a94862366272abf154e3d960a7ae8db7f9438e6d8474
7
+ data.tar.gz: 40f00dd2fcd119e05cded8bdb80475b0674812ae88afebaa8c197ed12baf82c0dbe045b60956039351108e49b1f83028ff300f3ea90c20213c47030cefeeb05a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coda_docs (1.0.0)
4
+ coda_docs (1.0.1)
5
5
  activesupport
6
6
  httparty
7
7
 
@@ -1,12 +1,12 @@
1
1
  module CodaDocs
2
2
  module Entities
3
3
  class Columns < Entity
4
- def all(doc_id:, table_id:)
5
- response = connection.get("/docs/#{doc_id}/tables/#{table_id}/columns")
4
+ def all(doc_id, table_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/tables/#{table_id}/columns", query: options)
6
6
  parse_response(response)
7
7
  end
8
8
 
9
- def find(doc_id:, table_id:, column_id:)
9
+ def find(doc_id, table_id, column_id)
10
10
  connection.get("/docs/#{doc_id}/tables/#{table_id}/columns/#{column_id}")
11
11
  end
12
12
  end
@@ -1,12 +1,12 @@
1
1
  module CodaDocs
2
2
  module Entities
3
3
  class Controls < Entity
4
- def all(doc_id)
5
- response = connection.get("/docs/#{doc_id}/controls")
4
+ def all(doc_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/controls", query: options)
6
6
  parse_response(response)
7
7
  end
8
8
 
9
- def find(doc_id:, control_id:)
9
+ def find(doc_id, control_id)
10
10
  connection.get("/docs/#{doc_id}/controls/#{control_id}")
11
11
  end
12
12
  end
@@ -10,36 +10,25 @@ module CodaDocs
10
10
  connection.get("/docs/#{doc_id}")
11
11
  end
12
12
 
13
- def create(title: 'Untitled', timezone: 'America/Los_Angeles', source_doc: nil, folder_id: nil)
13
+ def create(options)
14
14
  connection.post(
15
15
  '/docs',
16
- body: {
17
- title: title,
18
- sourceDoc: source_doc,
19
- timezone: timezone,
20
- folderId: folder_id
21
- }.to_json
16
+ body: options.to_json
22
17
  )
23
18
  end
24
19
 
25
- def delete(doc_id:)
20
+ def delete(doc_id)
26
21
  connection.delete("/docs/#{doc_id}")
27
22
  end
28
23
 
29
- def publish(doc_id:, slug:, discoverable:, earn_credit:, category_names:, mode:)
24
+ def publish(doc_id, options)
30
25
  connection.put(
31
26
  "/docs/#{doc_id}/publish",
32
- body: {
33
- slug: slug,
34
- discoverable: discoverable,
35
- earnCredit: earn_credit,
36
- categoryNames: category_names,
37
- mode: mode
38
- }.to_json
27
+ body: options.to_json
39
28
  )
40
29
  end
41
30
 
42
- def unpublish(doc_id:)
31
+ def unpublish(doc_id)
43
32
  connection.delete("/docs/#{doc_id}/publish")
44
33
  end
45
34
  end
@@ -1,13 +1,13 @@
1
1
  module CodaDocs
2
2
  module Entities
3
3
  class Formulas < Entity
4
- def all(doc_id)
4
+ def all(doc_id, options = nil)
5
5
  response = connection.get("/docs/#{doc_id}/formulas", query: options)
6
6
  parse_response(response)
7
7
  end
8
8
 
9
- def find(doc_id:, formula_id:)
10
- connection.get("/docs/#{doc_id}/formulas/#{formula_id}", query: options)
9
+ def find(doc_id, formula_id)
10
+ connection.get("/docs/#{doc_id}/formulas/#{formula_id}")
11
11
  end
12
12
  end
13
13
  end
@@ -1,7 +1,7 @@
1
1
  module CodaDocs
2
2
  module Entities
3
3
  class Miscellaneous < Entity
4
- def resolve_browser_link(url:, degrade_gracefully: true)
4
+ def resolve_browser_link(url, degrade_gracefully = true)
5
5
  connection.get('/resolveBrowserLink', query: { url: url, degradeGracefully: degrade_gracefully })
6
6
  end
7
7
  end
@@ -6,19 +6,14 @@ module CodaDocs
6
6
  parse_response(response)
7
7
  end
8
8
 
9
- def find(doc_id:, page_id:)
9
+ def find(doc_id, page_id, options = nil)
10
10
  connection.get("/docs/#{doc_id}/pages/#{page_id}", query: options)
11
11
  end
12
12
 
13
- def update(doc_id:, page_id:, name:, subtitle:, icon_name:, image_url:)
13
+ def update(doc_id, page_id, options)
14
14
  connection.put(
15
15
  "/docs/#{doc_id}/pages/#{page_id}",
16
- body: {
17
- name: name,
18
- subtitle: subtitle,
19
- iconName: icon_name,
20
- imageUrl: image_url
21
- }.to_json
16
+ body: options.to_json
22
17
  )
23
18
  end
24
19
  end
@@ -1,16 +1,16 @@
1
1
  module CodaDocs
2
2
  module Entities
3
3
  class Rows < Entity
4
- def all(doc_id:, table_id:)
5
- response = connection.get("/docs/#{doc_id}/tables/#{table_id}/rows")
4
+ def all(doc_id, table_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/tables/#{table_id}/rows", query: options)
6
6
  parse_response(response)
7
7
  end
8
8
 
9
- def find(doc_id:, table_id:, row_id:)
9
+ def find(doc_id, table_id, row_id)
10
10
  connection.get("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
11
11
  end
12
12
 
13
- def delete(doc_id:, table_id:, row_id:)
13
+ def delete(doc_id, table_id, row_id)
14
14
  connection.delete("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
15
15
  end
16
16
  end
@@ -1,12 +1,12 @@
1
1
  module CodaDocs
2
2
  module Entities
3
3
  class Tables < Entity
4
- def all(doc_id)
5
- response = connection.get("/docs/#{doc_id}/tables")
4
+ def all(doc_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/tables", query: options)
6
6
  parse_response(response)
7
7
  end
8
8
 
9
- def find(doc_id:, table_id:)
9
+ def find(doc_id, table_id)
10
10
  connection.get("/docs/#{doc_id}/tables/#{table_id}")
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module CodaDocs
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coda_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Muñoz
@@ -151,7 +151,6 @@ files:
151
151
  - lib/coda_docs/entities/controls.rb
152
152
  - lib/coda_docs/entities/docs.rb
153
153
  - lib/coda_docs/entities/entity.rb
154
- - lib/coda_docs/entities/folders.rb
155
154
  - lib/coda_docs/entities/formulas.rb
156
155
  - lib/coda_docs/entities/miscellaneous.rb
157
156
  - lib/coda_docs/entities/pages.rb
@@ -1,14 +0,0 @@
1
- module CodaDocs
2
- module Entities
3
- class Folders < Entity
4
- def all(doc_id)
5
- response = connection.get("/docs/#{doc_id}/folders", query: options)
6
- parse_response(response)
7
- end
8
-
9
- def find(doc_id:, folder_id:)
10
- connection.get("/docs/#{doc_id}/folders/#{folder_id}", query: options)
11
- end
12
- end
13
- end
14
- end