Sha256: 6d9b2b41540919b1ef0c44ea6dde98bdb999035ab69a18e3ccedfd45c99ebf02

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

module TrackerApi
  module Endpoints
    class Tasks
      attr_accessor :client

      def initialize(client)
        @client = client
      end

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

        data.map { |task| Resources::Task.new({ client: client }.merge(task)) }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tracker_api-0.2.5 lib/tracker_api/endpoints/tasks.rb
tracker_api-0.2.4 lib/tracker_api/endpoints/tasks.rb