Module: TestRail::Client::Projects

Included in:
API
Defined in:
lib/testrail_api/client/projects.rb

Overview

Methods for the Projects API

Instance Method Summary collapse

Instance Method Details

#project(project_id) ⇒ Object

Returns an existing project by its ID.

:project_id The ID of the project



24
25
26
# File 'lib/testrail_api/client/projects.rb', line 24

def project(project_id)
  get("get_project/#{project_id}")
end

#project_by_name(project_name) ⇒ Object

Returns an existing project by its name.

:project_name The name of the project



33
34
35
# File 'lib/testrail_api/client/projects.rb', line 33

def project_by_name(project_name)
  projects.find { |project| project['name'].casecmp(project_name) == 0 }
end

#projectsObject

Returns the list of available projects.



10
11
12
# File 'lib/testrail_api/client/projects.rb', line 10

def projects
  get('get_projects')
end

#projects_idsObject

TODO: finish docs



15
16
17
# File 'lib/testrail_api/client/projects.rb', line 15

def projects_ids
  projects.map { |x| x['id'] }
end