Class: Researchable::FreedcampApi::ListProjects

Inherits:
Endpoint
  • Object
show all
Defined in:
lib/researchable/freedcamp_api/list_projects.rb

Instance Method Summary collapse

Instance Method Details

#executeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
# File 'lib/researchable/freedcamp_api/list_projects.rb', line 13

def execute
  list_projects(project_id)
end

#list_projects(project_id) ⇒ Object

sig do params( project_id: T.nilable(Integer) ).returns( T::Array ) end



24
25
26
27
28
29
30
# File 'lib/researchable/freedcamp_api/list_projects.rb', line 24

def list_projects(project_id)
  project_query = project_id ? "/#{project_id}" : '/'
  fetch_all('projects') do |limit, offset|
    session.get("/projects#{project_query}?limit=#{limit}
             &offset=#{offset}")
  end
end