Class: Gitcamp::Basecamp::Todo
- Inherits:
-
Object
- Object
- Gitcamp::Basecamp::Todo
- Defined in:
- lib/gitcamp/basecamp/todo.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#issue ⇒ Object
readonly
Returns the value of attribute issue.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Todo
constructor
A new instance of Todo.
- #save ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Todo
Returns a new instance of Todo.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/gitcamp/basecamp/todo.rb', line 6 def initialize( = {}) unless [:issue] raise ArgumentError, 'no GitHub Issue given' end @list = [:list] @issue = [:issue] @title = @issue.title.gsub(/\[[\d\.]*\]\s+/, '') @title = "##{issue.number} #{@title}" end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/gitcamp/basecamp/todo.rb', line 4 def description @description end |
#issue ⇒ Object (readonly)
Returns the value of attribute issue.
4 5 6 |
# File 'lib/gitcamp/basecamp/todo.rb', line 4 def issue @issue end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
4 5 6 |
# File 'lib/gitcamp/basecamp/todo.rb', line 4 def item @item end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
4 5 6 |
# File 'lib/gitcamp/basecamp/todo.rb', line 4 def list @list end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/gitcamp/basecamp/todo.rb', line 4 def title @title end |
Instance Method Details
#save ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/gitcamp/basecamp/todo.rb', line 18 def save find_or_build_todo if item.save say "Processed todo #{title} in Basecamp" end create_or_update_comment end |