Class: Gub::Issue
- Inherits:
-
Object
- Object
- Gub::Issue
- Defined in:
- lib/gub/issue.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#info ⇒ Object
Returns the value of attribute info.
-
#parent ⇒ Object
Returns the value of attribute parent.
Class Method Summary collapse
Instance Method Summary collapse
- #assign(login = nil) ⇒ Object
- #assignee ⇒ Object
- #branch ⇒ Object
- #close ⇒ Object
- #comment(body) ⇒ Object
- #comments ⇒ Object
-
#initialize(parent, id) ⇒ Issue
constructor
A new instance of Issue.
- #reopen ⇒ Object
- #repository ⇒ Object
- #request_pull ⇒ Object
Constructor Details
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/gub/issue.rb', line 3 def id @id end |
#info ⇒ Object
Returns the value of attribute info.
3 4 5 |
# File 'lib/gub/issue.rb', line 3 def info @info end |
#parent ⇒ Object
Returns the value of attribute parent.
3 4 5 |
# File 'lib/gub/issue.rb', line 3 def parent @parent end |
Class Method Details
Instance Method Details
#assign(login = nil) ⇒ Object
40 41 42 43 |
# File 'lib/gub/issue.rb', line 40 def assign login = nil assignee = login || Gub.github.user.login Gub.github.update_issue self.parent, self.id, self.info[:title], self.info[:body], { assignee: assignee } end |
#assignee ⇒ Object
36 37 38 |
# File 'lib/gub/issue.rb', line 36 def assignee self.info[:user] end |
#branch ⇒ Object
45 46 47 |
# File 'lib/gub/issue.rb', line 45 def branch "issue-#{self.id}" end |
#close ⇒ Object
24 25 26 |
# File 'lib/gub/issue.rb', line 24 def close Gub.github.close_issue(self.parent, self.id) end |
#comment(body) ⇒ Object
28 29 30 |
# File 'lib/gub/issue.rb', line 28 def comment body Gub.github.add_comment(self.parent, self.id, body) end |
#comments ⇒ Object
32 33 34 |
# File 'lib/gub/issue.rb', line 32 def comments Gub.github.issue_comments(self.parent, self.id) end |
#reopen ⇒ Object
20 21 22 |
# File 'lib/gub/issue.rb', line 20 def reopen Gub.github.reopen_issue(self.parent, self.id) end |
#repository ⇒ Object
16 17 18 |
# File 'lib/gub/issue.rb', line 16 def repository Gub::Repository.new(self.parent) end |
#request_pull ⇒ Object
49 50 51 |
# File 'lib/gub/issue.rb', line 49 def request_pull Gub.github.create_pull_request_for_issue(self.parent, 'master', "#{Gub.current_user}:#{self.branch}", self.id) end |