Module: Panoptes::Client::Projects
- Included in:
- Panoptes::Client
- Defined in:
- lib/panoptes/client/projects.rb
Instance Method Summary collapse
-
#create_aggregations_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of the aggretation results of the project.
-
#create_classifications_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the classifications in the project.
-
#create_subjects_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the subjects in the project.
-
#create_workflow_contents_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the workflow_contents in the project.
-
#create_workflows_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the workflows in the project.
-
#project(project_id) ⇒ Hash
Fetches the specified project.
-
#projects(search: nil) ⇒ Array
Fetches the list of all projects.
Instance Method Details
#create_aggregations_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of the aggretation results of the project.
72 73 74 75 76 |
# File 'lib/panoptes/client/projects.rb', line 72 def create_aggregations_export(project_id) params = export_params('application/x-gzip') path = export_path(project_id, 'aggregations_export') panoptes.post(path, params)['media'].first end |
#create_classifications_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the classifications in the project.
32 33 34 35 36 |
# File 'lib/panoptes/client/projects.rb', line 32 def create_classifications_export(project_id) params = export_params('text/csv') path = export_path(project_id, 'classifications_export') panoptes.post(path, params)['media'].first end |
#create_subjects_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the subjects in the project.
42 43 44 45 46 |
# File 'lib/panoptes/client/projects.rb', line 42 def create_subjects_export(project_id) params = export_params('text/csv') path = export_path(project_id, 'subjects_export') panoptes.post(path, params)['media'].first end |
#create_workflow_contents_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the workflow_contents in the project.
62 63 64 65 66 |
# File 'lib/panoptes/client/projects.rb', line 62 def create_workflow_contents_export(project_id) params = export_params('text/csv') path = export_path(project_id, 'workflow_contents_export') panoptes.post(path, params)['media'].first end |
#create_workflows_export(project_id) ⇒ Hash
Starts a background process to generate a new CSV export of all the workflows in the project.
52 53 54 55 56 |
# File 'lib/panoptes/client/projects.rb', line 52 def create_workflows_export(project_id) params = export_params('text/csv') path = export_path(project_id, 'workflows_export') panoptes.post(path, params)['media'].first end |
#project(project_id) ⇒ Hash
Fetches the specified project
23 24 25 26 |
# File 'lib/panoptes/client/projects.rb', line 23 def project(project_id) response = panoptes.get("/projects/#{project_id}") response.fetch('projects').find { |i| i.fetch('id').to_s == project_id.to_s } end |
#projects(search: nil) ⇒ Array
Fetches the list of all projects.
11 12 13 14 15 16 |
# File 'lib/panoptes/client/projects.rb', line 11 def projects(search: nil) params = {} params[:search] = search if search panoptes.paginate('/projects', params)['projects'] end |