Class: TotenDev::ProjectController
- Inherits:
-
Controller
show all
- Defined in:
- lib/tdev_metrics/controllers/project_controller.rb
Instance Attribute Summary
Attributes inherited from Controller
#base_url, #password, #username
Instance Method Summary
collapse
Methods inherited from Controller
#get, #initialize, #post, #request
Instance Method Details
#create(title) ⇒ Object
11
12
13
14
|
# File 'lib/tdev_metrics/controllers/project_controller.rb', line 11
def create( title )
req = post 'project/create', { :title => title }
req.is_a? Net::HTTPSuccess
end
|
#delete(id) ⇒ Object
21
22
23
24
|
# File 'lib/tdev_metrics/controllers/project_controller.rb', line 21
def delete( id )
req = post "project/delete/#{id}"
req.is_a? Net::HTTPSuccess
end
|
#list(project = nil, params = {}) ⇒ Object
26
27
28
29
30
|
# File 'lib/tdev_metrics/controllers/project_controller.rb', line 26
def list( project = nil, params = {} )
req = get list_endpoint_for_project( project ), params
return nil unless req.is_a? Net::HTTPSuccess
list_parse_response req.body
end
|
#update(id, title) ⇒ Object
16
17
18
19
|
# File 'lib/tdev_metrics/controllers/project_controller.rb', line 16
def update( id, title )
req = post "project/update/#{id}", { :title => title }
req.is_a? Net::HTTPSuccess
end
|