Class: Waff::Issue
- Inherits:
-
Object
- Object
- Waff::Issue
- Defined in:
- lib/waff/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.
5 6 7 8 9 10 11 |
# File 'lib/waff/issue.rb', line 5 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.
3 4 5 |
# File 'lib/waff/issue.rb', line 3 def body @body end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
3 4 5 |
# File 'lib/waff/issue.rb', line 3 def labels @labels end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/waff/issue.rb', line 3 def number @number end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
3 4 5 |
# File 'lib/waff/issue.rb', line 3 def repository @repository end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/waff/issue.rb', line 3 def title @title end |
Instance Method Details
#assign_to_self! ⇒ Object
19 20 21 |
# File 'lib/waff/issue.rb', line 19 def assign_to_self! repository.assign_issue number end |
#create_local_branch! ⇒ Object
13 14 15 16 17 |
# File 'lib/waff/issue.rb', line 13 def create_local_branch! branch_name = "#{number}-#{slug}" puts "Creating branch #{branch_name}" `git checkout -b '#{branch_name}'` end |
#mark_in_progress! ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/waff/issue.rb', line 23 def mark_in_progress! labels.delete 'ready' labels.delete 'to do' labels << 'in progress' repository.export_labels self end |
#mark_ready! ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/waff/issue.rb', line 31 def mark_ready! labels << 'ready' labels << 'to do' labels.delete 'in progress' repository.export_labels self end |