Sha256: d3727180b96aff2186fb50bb8d550acae2c984d0407b397261da9152f702e6a1

Contents?: true

Size: 590 Bytes

Versions: 5

Compression:

Stored size: 590 Bytes

Contents

module TrackerApi
  module Endpoints
    class Stories
      attr_accessor :client

      def initialize(client)
        @client = client
      end

      def get(project_id, params={})
        url = params[:ids] ? "/projects/#{project_id}/stories/bulk" : "/projects/#{project_id}/stories"
        data = client.paginate(url, params: params)

        raise Errors::UnexpectedData, 'Array of stories expected' unless data.is_a? Array

        data.map do |story|
          Resources::Story.new({ client: client, project_id: project_id }.merge(story))
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tracker_api-1.9.0 lib/tracker_api/endpoints/stories.rb
tracker_api-1.8.0 lib/tracker_api/endpoints/stories.rb
tracker_api-1.7.1 lib/tracker_api/endpoints/stories.rb
tracker_api-1.7.0 lib/tracker_api/endpoints/stories.rb
tracker_api-1.6.0 lib/tracker_api/endpoints/stories.rb