Class: FreshdeskAPI::SolutionArticle

Inherits:
Resource show all
Defined in:
lib/freshdesk_api/resources/solution_article.rb

Instance Attribute Summary

Attributes inherited from Data

#attributes, #errors

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Read

extended, #find, #find!

Methods included from Destroy

#destroy, #destroy!, #destroyed?, included

Methods included from Update

included, #update, #update!

Methods included from Save

#save, #save!

Methods included from ResponseHandler

#handle_response

Methods included from Create

included

Methods inherited from Data

#==, #id, #initialize, #inspect, #new_record?, resource_name, singular_resource_name, #to_s

Constructor Details

This class inherits a constructor from FreshdeskAPI::Data

Class Method Details

.api_url(options = {}) ⇒ Object



22
23
24
# File 'lib/freshdesk_api/resources/solution_article.rb', line 22

def api_url(options = {})
  format('/solution/categories/%<category_id>/folders/%<folder_id>/articles', options)
end

.collection_namespaceObject



26
27
28
# File 'lib/freshdesk_api/resources/solution_article.rb', line 26

def collection_namespace
  'folder/articles'
end

Instance Method Details

#api_url(_options = {}) ⇒ Object

Need to specify the category_id and folder_id in url



9
10
11
# File 'lib/freshdesk_api/resources/solution_article.rb', line 9

def api_url(_options = {})
  format('/solution/categories/%<category_id>/folders/%<folder_id>/articles', attributes)
end

#request_namespaceObject



13
14
15
# File 'lib/freshdesk_api/resources/solution_article.rb', line 13

def request_namespace
  'solution_article'
end

#response_namespaceObject



17
18
19
# File 'lib/freshdesk_api/resources/solution_article.rb', line 17

def response_namespace
  :article
end