Sha256: b32fa05440bda260cc07adbbc3d353d172626f6f38e6127893e300d705265131

Contents?: true

Size: 527 Bytes

Versions: 21

Compression:

Stored size: 527 Bytes

Contents

module TrackerApi
  module Endpoints
    class Stories
      attr_accessor :client

      def initialize(client)
        @client = client
      end

      def get(project_id, params={})
        data = client.paginate("/projects/#{project_id}/stories", params: params)
        raise TrackerApi::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

21 entries across 21 versions & 2 rubygems

Version Path
tracker_api-0.2.6 lib/tracker_api/endpoints/stories.rb