Sha256: 2260558a4049a3a0448214c69cf264740d710ff671392ef305523b23e2225d84

Contents?: true

Size: 503 Bytes

Versions: 6

Compression:

Stored size: 503 Bytes

Contents

module TrackerApi
  module Endpoints
    class Iterations
      attr_accessor :client

      def initialize(client)
        @client = client
      end

      def get(project_id, params={})
        data = client.paginate("/projects/#{project_id}/iterations", params: params)
        raise TrackerApi::Errors::UnexpectedData, 'Array of iterations expected' unless data.is_a? Array

        data.map { |iteration| Resources::Iteration.new({ client: client }.merge(iteration)) }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tracker_api-0.2.5 lib/tracker_api/endpoints/iterations.rb
tracker_api-0.2.4 lib/tracker_api/endpoints/iterations.rb
tracker_api-0.2.3 lib/tracker_api/endpoints/iterations.rb
tracker_api-0.2.2 lib/tracker_api/endpoints/iterations.rb
tracker_api-0.2.1 lib/tracker_api/endpoints/iterations.rb
tracker_api-0.2.0 lib/tracker_api/endpoints/iterations.rb