Sha256: db6054ec88a76d3cb18e9125ae4c77d06210e3145ba0a8762a2ca9a9a798e6eb

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

module TrackerApi
  module Endpoints
    class Stories
      attr_accessor :client

      def initialize(client)
        @client = client
      end

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

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