lib/tracker_api/endpoints/projects.rb in tracker_api-0.1.0 vs lib/tracker_api/endpoints/projects.rb in tracker_api-0.2.0
- old
+ new
@@ -6,14 +6,10 @@
def initialize(client)
@client = client
end
def get(params={})
- data = client.request(
- method: :get,
- path: '/projects',
- params: params
- ).body
+ data = client.paginate('/projects', params: params)
raise TrackerApi::Errors::UnexpectedData, 'Array of projects expected' unless data.is_a? Array
data.map { |project| Resources::Project.new({ client: client }.merge(project)) }
end
end