Sha256: da2ab0994fe77d151e43f6788448abec52ecf5e2016591f0b886323c2844cc0a

Contents?: true

Size: 806 Bytes

Versions: 8

Compression:

Stored size: 806 Bytes

Contents

# frozen_string_literal: true

module Geet
  module Gitlab
    class Issue
      attr_reader :number, :title, :link

      def initialize(number, title, link)
        @number = number
        @title = title
        @link = link
      end

      def self.list(api_interface, assignee: nil)
        raise "Assignee filtering not currently supported!" if assignee

        api_path = "projects/#{api_interface.path_with_namespace(encoded: true)}/issues"

        response = api_interface.send_request(api_path, multipage: true)

        response.each_with_object([]) do |issue_data, result|
          number = issue_data.fetch('iid')
          title = issue_data.fetch('title')
          link = issue_data.fetch('web_url')

          result << new(number, title, link)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geet-0.3.6 lib/geet/gitlab/issue.rb
geet-0.3.5 lib/geet/gitlab/issue.rb
geet-0.3.4 lib/geet/gitlab/issue.rb
geet-0.3.3 lib/geet/gitlab/issue.rb
geet-0.3.2 lib/geet/gitlab/issue.rb
geet-0.3.1 lib/geet/gitlab/issue.rb
geet-0.3.0 lib/geet/gitlab/issue.rb
geet-0.2.1 lib/geet/gitlab/issue.rb