Sha256: a53c81ab178dfe2b90daf63790b5a73190108676b81e0a2392a3d2a3d35b4704

Contents?: true

Size: 546 Bytes

Versions: 2

Compression:

Stored size: 546 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

2 entries across 2 versions & 1 rubygems

Version Path
tracker_api-0.2.9 lib/tracker_api/endpoints/comments.rb
tracker_api-0.2.8 lib/tracker_api/endpoints/comments.rb