Sha256: de8263471e985c42920906e556be0d54a1226bc7a20605b9963580cb51a973d2

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

module TrackerApi
  module Endpoints
    class Comments
      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}/comments", params: params)
        raise TrackerApi::Errors::UnexpectedData, 'Array of comments expected' unless data.is_a? Array

        data.map do |comment|
          Resources::Comment.new({ story_id: story_id }.merge(comment))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tracker_api-0.2.10 lib/tracker_api/endpoints/comments.rb