Class: HubLink::Api::Issue
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- HubLink::Api::Issue
- Defined in:
- lib/hub_link/api/issue.rb
Direct Known Subclasses
Constant Summary collapse
- EXPORT_COLUMNS =
%i( id title number created_at updated_at closed_at submitter labels repo html_url state )
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.list(repo:, page:, **options) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/hub_link/api/issue.rb', line 21 def self.list(repo:, page:, **) Octokit.list_issues(repo, .merge(page: page, sort: "updated", direction: "asc", state: "all")).map do |item| item.repo = repo new_from_api(item) end end |
.new_from_api(item) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/hub_link/api/issue.rb', line 28 def self.new_from_api(item) if item.respond_to?(:pull_request) PullRequest.new(item) else Issue.new(item) end end |
Instance Method Details
#labels ⇒ Object
44 45 46 |
# File 'lib/hub_link/api/issue.rb', line 44 def labels super.map(&:name).join(", ") end |
#pull_request? ⇒ Boolean
36 37 38 |
# File 'lib/hub_link/api/issue.rb', line 36 def pull_request? false end |
#submitter ⇒ Object
40 41 42 |
# File 'lib/hub_link/api/issue.rb', line 40 def submitter user.login end |