Class: Cp8Cli::Github::Issue
- Includes:
- Storyable
- Defined in:
- lib/cp8_cli/github/issue.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(number:, repo:, attributes:) ⇒ Issue
constructor
A new instance of Issue.
- #pr_title ⇒ Object
- #short_link ⇒ Object
- #start ⇒ Object
- #summary ⇒ Object
- #title ⇒ Object
- #url ⇒ Object
Methods included from Storyable
Methods inherited from Base
Constructor Details
#initialize(number:, repo:, attributes:) ⇒ Issue
Returns a new instance of Issue.
11 12 13 14 15 |
# File 'lib/cp8_cli/github/issue.rb', line 11 def initialize(number:, repo:, attributes:) @number = number @repo = repo @attributes = attributes end |
Class Method Details
.fields ⇒ Object
17 18 19 |
# File 'lib/cp8_cli/github/issue.rb', line 17 def self.fields [:title] end |
.find_by_short_link(short_link) ⇒ Object
27 28 29 30 31 |
# File 'lib/cp8_cli/github/issue.rb', line 27 def self.find_by_short_link(short_link) short_link = ParsedShortLink.new(short_link) issue = client.issue(short_link.repo, short_link.number) new number: short_link.number, repo: short_link.repo, attributes: issue end |
.find_by_url(url) ⇒ Object
21 22 23 24 25 |
# File 'lib/cp8_cli/github/issue.rb', line 21 def self.find_by_url(url) url = ParsedUrl.new(url) issue = client.issue(url.repo, url.number) new number: url.number, repo: url.repo, attributes: issue end |
Instance Method Details
#pr_title ⇒ Object
37 38 39 |
# File 'lib/cp8_cli/github/issue.rb', line 37 def pr_title title end |
#short_link ⇒ Object
53 54 55 |
# File 'lib/cp8_cli/github/issue.rb', line 53 def short_link "#{repo}##{number}" end |
#start ⇒ Object
49 50 51 |
# File 'lib/cp8_cli/github/issue.rb', line 49 def start assign CurrentUser.new end |
#summary ⇒ Object
45 46 47 |
# File 'lib/cp8_cli/github/issue.rb', line 45 def summary "Closes #{short_link}" end |
#title ⇒ Object
33 34 35 |
# File 'lib/cp8_cli/github/issue.rb', line 33 def title attributes[:title] end |
#url ⇒ Object
41 42 43 |
# File 'lib/cp8_cli/github/issue.rb', line 41 def url attributes[:html_url] end |