Class: Issue
- Inherits:
-
Object
- Object
- Issue
- Defined in:
- lib/issue.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #assign_to_self! ⇒ Object
- #create_local_branch! ⇒ Object
-
#initialize(repository, data) ⇒ Issue
constructor
A new instance of Issue.
- #mark_in_progress! ⇒ Object
- #mark_ready! ⇒ Object
Constructor Details
#initialize(repository, data) ⇒ Issue
Returns a new instance of Issue.
4 5 6 7 8 9 10 |
# File 'lib/issue.rb', line 4 def initialize(repository, data) @repository = repository @number = data['number'] @title = data['title'] @body = data['body'] parse_labels data end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
2 3 4 |
# File 'lib/issue.rb', line 2 def body @body end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
2 3 4 |
# File 'lib/issue.rb', line 2 def labels @labels end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
2 3 4 |
# File 'lib/issue.rb', line 2 def number @number end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
2 3 4 |
# File 'lib/issue.rb', line 2 def repository @repository end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
2 3 4 |
# File 'lib/issue.rb', line 2 def title @title end |
Instance Method Details
#assign_to_self! ⇒ Object
18 19 20 |
# File 'lib/issue.rb', line 18 def assign_to_self! repository.assign_issue number end |
#create_local_branch! ⇒ Object
12 13 14 15 16 |
# File 'lib/issue.rb', line 12 def create_local_branch! branch_name = "##{number}-#{Helper.slug title}" puts "Creating branch #{branch_name}" `git checkout -b '#{branch_name}'` end |
#mark_in_progress! ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/issue.rb', line 22 def mark_in_progress! labels.delete 'ready' labels.delete 'to do' labels << 'in progress' repository.export_labels self end |
#mark_ready! ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/issue.rb', line 30 def mark_ready! labels << 'ready' labels << 'to do' labels.delete 'in progress' repository.export_labels self end |