Module: Voog::API::Articles
- Included in:
- Client
- Defined in:
- lib/voog_api/api/articles.rb
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 a article.
-
#create_article_content(article_id, data) ⇒ Object
Create a article content for article.
-
#delete_article(id) ⇒ Object
Delete a 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 a article.
-
#update_article(id, data) ⇒ Object
Update a 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
11 12 13 |
# File 'lib/voog_api/api/articles.rb', line 11 def article(id, params = {}) get "articles/#{id}", {query: params} end |
#article_content(article_id, id, params = {}) ⇒ Object
Get a single content for article
57 58 59 |
# File 'lib/voog_api/api/articles.rb', line 57 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
52 53 54 |
# File 'lib/voog_api/api/articles.rb', line 52 def article_contents(id, params = {}) contents(Voog::API::Contents::ParentKind::Article, id, params) end |
#articles(params = {}) ⇒ Object
List articles
6 7 8 |
# File 'lib/voog_api/api/articles.rb', line 6 def articles(params = {}) paginate 'articles', {query: params} end |
#create_article(data) ⇒ Object
Create a article
16 17 18 |
# File 'lib/voog_api/api/articles.rb', line 16 def create_article(data) post 'articles', data end |
#create_article_content(article_id, data) ⇒ Object
Create a article content for article
62 63 64 |
# File 'lib/voog_api/api/articles.rb', line 62 def create_article_content(article_id, data) create_content(Voog::API::Contents::ParentKind::Article, article_id, data) end |
#delete_article(id) ⇒ Object
Delete a article
31 32 33 |
# File 'lib/voog_api/api/articles.rb', line 31 def delete_article(id) delete "articles/#{id}" end |
#delete_article_content(article_id, id) ⇒ Object
Delete a content from article
67 68 69 |
# File 'lib/voog_api/api/articles.rb', line 67 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
45 46 47 |
# File 'lib/voog_api/api/articles.rb', line 45 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
72 73 74 |
# File 'lib/voog_api/api/articles.rb', line 72 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 a article
26 27 28 |
# File 'lib/voog_api/api/articles.rb', line 26 def patch_article(id, data) patch "articles/#{id}", data end |
#update_article(id, data) ⇒ Object
Update a article
21 22 23 |
# File 'lib/voog_api/api/articles.rb', line 21 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
38 39 40 |
# File 'lib/voog_api/api/articles.rb', line 38 def update_article_data(article_id, id, data) put "articles/#{article_id}/data/#{id}", {value: data} end |