class Cp8Cli::Github::Issue
Attributes
attributes[R]
number[R]
repo[R]
Public Class Methods
find_by_url(url)
click to toggle source
# File lib/cp8_cli/github/issue.rb, line 16 def self.find_by_url(url) url = ParsedUrl.new(url) issue = client.issue(url.repo, url.number).to_h new(**issue.merge(number: url.number, repo: url.repo)) end
new(number:, repo:, **attributes)
click to toggle source
# File lib/cp8_cli/github/issue.rb, line 10 def initialize(number:, repo:, **attributes) @number = number @repo = repo @attributes = attributes end
Public Instance Methods
summary()
click to toggle source
# File lib/cp8_cli/github/issue.rb, line 26 def summary "Closes #{short_link}" end
title()
click to toggle source
# File lib/cp8_cli/github/issue.rb, line 22 def title attributes[:title] end
Private Instance Methods
assign()
click to toggle source
# File lib/cp8_cli/github/issue.rb, line 34 def assign client.add_assignees repo, number, [user.github_login] end
short_link()
click to toggle source
# File lib/cp8_cli/github/issue.rb, line 42 def short_link "#{repo}##{number}" end
user()
click to toggle source
# File lib/cp8_cli/github/issue.rb, line 38 def user CurrentUser.new end