Class: HelpScoutDocs::Article
- Defined in:
- lib/help_scout_docs/methods/article.rb
Instance Attribute Summary
Attributes inherited from Method
Instance Method Summary collapse
-
#get(id, options = {}) ⇒ Object
Get an article.
-
#get_revision(id, options = {}) ⇒ Object
Get a article’s revision.
-
#list(id, type = :category, options = {}) ⇒ Object
List all articles.
-
#list_by_category(category_id, options = {}) ⇒ Object
List all articles.
-
#list_by_collection(collection_id, options = {}) ⇒ Object
List all articles.
-
#related(id, options = {}) ⇒ Object
Get a related articles.
-
#revisions(id, options = {}) ⇒ Object
Get a article’s revisions.
Methods inherited from Method
#client?, #initialize, #initialize_client
Constructor Details
This class inherits a constructor from HelpScoutDocs::Method
Instance Method Details
#get(id, options = {}) ⇒ Object
Get an article
23 24 25 |
# File 'lib/help_scout_docs/methods/article.rb', line 23 def get(id, ={}) get_request("articles/#{id}", ) end |
#get_revision(id, options = {}) ⇒ Object
Get a article’s revision
41 42 43 |
# File 'lib/help_scout_docs/methods/article.rb', line 41 def get_revision(id, ={}) get_request("revisions/#{id}", ) end |
#list(id, type = :category, options = {}) ⇒ Object
List all articles
5 6 7 |
# File 'lib/help_scout_docs/methods/article.rb', line 5 def list(id, type=:category, ={}) public_send(:"list_by_#{type}", id, ) end |
#list_by_category(category_id, options = {}) ⇒ Object
List all articles
11 12 13 |
# File 'lib/help_scout_docs/methods/article.rb', line 11 def list_by_category(category_id, ={}) get_request("categories/#{category_id}/articles", ) end |
#list_by_collection(collection_id, options = {}) ⇒ Object
List all articles
17 18 19 |
# File 'lib/help_scout_docs/methods/article.rb', line 17 def list_by_collection(collection_id, ={}) get_request("collections/#{collection_id}/articles", ) end |
#related(id, options = {}) ⇒ Object
Get a related articles
29 30 31 |
# File 'lib/help_scout_docs/methods/article.rb', line 29 def (id, ={}) get_request("articles/#{id}/related", ) end |
#revisions(id, options = {}) ⇒ Object
Get a article’s revisions
35 36 37 |
# File 'lib/help_scout_docs/methods/article.rb', line 35 def revisions(id, ={}) get_request("articles/#{id}/revisions", ) end |