Module: Voog::API::Articles
- Included in:
- Client
- Defined in:
- lib/voog_api/api/articles.rb
Overview
Voog Articles API methods.
Instance Method Summary collapse
-
#article(id, params = {}) ⇒ Object
Get a single article.
-
#article_content(article_id, id, params = {}) ⇒ Object
Get a single content for article.
-
#article_contents(id, params = {}) ⇒ Object
List contents for article.
-
#articles(params = {}) ⇒ Object
List articles.
-
#create_article(data) ⇒ Object
Create an article.
-
#create_article_content(article_id, data) ⇒ Object
Create an article content for article.
-
#delete_article(id) ⇒ Object
Delete an article.
-
#delete_article_content(article_id, id) ⇒ Object
Delete a content from article.
-
#delete_article_data(article_id, id) ⇒ Object
Delete a key from article data field.
-
#move_article_content(article_id, id, params = {}) ⇒ Object
Reorder/move article content inside/between content areas and parent objects.
-
#patch_article(id, data) ⇒ Object
Patch an article.
-
#update_article(id, data) ⇒ Object
Update an article.
-
#update_article_data(article_id, id, data) ⇒ Object
Update/create a key in article data field.
Instance Method Details
#article(id, params = {}) ⇒ Object
Get a single article
19 20 21 |
# File 'lib/voog_api/api/articles.rb', line 19 def article(id, params = {}) get "articles/#{id}", {query: params} end |
#article_content(article_id, id, params = {}) ⇒ Object
Get a single content for article
81 82 83 |
# File 'lib/voog_api/api/articles.rb', line 81 def article_content(article_id, id, params = {}) content(Voog::API::Contents::ParentKind::Article, article_id, id, params) end |
#article_contents(id, params = {}) ⇒ Object
List contents for article
74 75 76 |
# File 'lib/voog_api/api/articles.rb', line 74 def article_contents(id, params = {}) contents(Voog::API::Contents::ParentKind::Article, id, params) end |
#articles(params = {}) ⇒ Object
List articles
12 13 14 |
# File 'lib/voog_api/api/articles.rb', line 12 def articles(params = {}) paginate 'articles', {query: params} end |
#create_article(data) ⇒ Object
Create an article
26 27 28 |
# File 'lib/voog_api/api/articles.rb', line 26 def create_article(data) post 'articles', data end |
#create_article_content(article_id, data) ⇒ Object
Create an article content for article
88 89 90 |
# File 'lib/voog_api/api/articles.rb', line 88 def create_article_content(article_id, data) create_content(Voog::API::Contents::ParentKind::Article, article_id, data) end |
#delete_article(id) ⇒ Object
Delete an article
47 48 49 |
# File 'lib/voog_api/api/articles.rb', line 47 def delete_article(id) delete "articles/#{id}" end |
#delete_article_content(article_id, id) ⇒ Object
Delete a content from article
95 96 97 |
# File 'lib/voog_api/api/articles.rb', line 95 def delete_article_content(article_id, id) delete_content(Voog::API::Contents::ParentKind::Article, article_id, id) end |
#delete_article_data(article_id, id) ⇒ Object
Delete a key from article data field
65 66 67 |
# File 'lib/voog_api/api/articles.rb', line 65 def delete_article_data(article_id, id) delete "articles/#{article_id}/data/#{id}" end |
#move_article_content(article_id, id, params = {}) ⇒ Object
Reorder/move article content inside/between content areas and parent objects
102 103 104 |
# File 'lib/voog_api/api/articles.rb', line 102 def move_article_content(article_id, id, params = {}) move_content(Voog::API::Contents::ParentKind::Article, article_id, id, params) end |
#patch_article(id, data) ⇒ Object
Patch an article
40 41 42 |
# File 'lib/voog_api/api/articles.rb', line 40 def patch_article(id, data) patch "articles/#{id}", data end |
#update_article(id, data) ⇒ Object
Update an article
33 34 35 |
# File 'lib/voog_api/api/articles.rb', line 33 def update_article(id, data) put "articles/#{id}", data end |
#update_article_data(article_id, id, data) ⇒ Object
Update/create a key in article data field
56 57 58 |
# File 'lib/voog_api/api/articles.rb', line 56 def update_article_data(article_id, id, data) put "articles/#{article_id}/data/#{id}", {value: data} end |