Module: Roadmaps
Instance Method Summary collapse
-
#get_roadmap(id) ⇒ Roadmap
Get a roadmap.
-
#get_sections_for_roadmap(id) ⇒ HTTParty::Response
Get a roadmap’s sections.
-
#update_roadmap(id, options = {}) ⇒ Roadmap
Update a roadmap.
Methods included from BaseClient
#auth_header, #convert_keys, #convert_response, #handle_timeouts, #success?, #whitelist_params
Instance Method Details
#get_roadmap(id) ⇒ Roadmap
Get a roadmap
12 13 14 15 16 17 18 19 |
# File 'lib/client/roadmaps.rb', line 12 def get_roadmap(id) url = "#{@api_base_path}/roadmaps/#{id}" handle_timeouts do response = self.class.get(url, headers: auth_header) convert_response(response, "roadmap") end end |
#get_sections_for_roadmap(id) ⇒ HTTParty::Response
Get a roadmap’s sections
27 28 29 30 31 32 33 34 |
# File 'lib/client/roadmaps.rb', line 27 def get_sections_for_roadmap(id) url = "#{@api_base_path}/roadmaps/#{id}/sections" handle_timeouts do response = self.class.get(url, headers: auth_header) convert_response(response, "section") end end |
#update_roadmap(id, options = {}) ⇒ Roadmap
Update a roadmap
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/client/roadmaps.rb', line 47 def update_roadmap(id, ={}) whitelist = ['name', 'display_name', 'version', 'projects'] = convert_keys() roadmap_params = whitelist_params(, whitelist) url = "#{@api_base_path}/roadmaps/#{id}" handle_timeouts do response = self.class.put(url, headers: auth_header, body: { roadmap: roadmap_params }) convert_response(response, "roadmap") end end |