Method: Geet::Github::AbstractIssue.list
- Defined in:
- lib/geet/github/abstract_issue.rb
.list(api_interface, milestone: nil, assignee: nil, &type_filter) ⇒ Object
See developer.github.com/v3/issues/#list-issues-for-a-repository
This works both for Issues and PRs, however, when the /pulls API (path) is used, additional information is provided (e.g. head).
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/geet/github/abstract_issue.rb', line 28 def self.list(api_interface, milestone: nil, assignee: nil, &type_filter) api_path = 'issues' request_params = {} request_params[:milestone] = milestone.number if milestone request_params[:assignee] = assignee.username if assignee response = api_interface.send_request(api_path, params: request_params, multipage: true) abstract_issues_list = response.map do |issue_data| number = issue_data.fetch('number') title = issue_data.fetch('title') link = issue_data.fetch('html_url') new(number, api_interface, title, link) if type_filter.nil? || type_filter.call(issue_data) end abstract_issues_list.compact end |