Class: Rudoo::Task
- Inherits:
-
Object
- Object
- Rudoo::Task
- Defined in:
- lib/rudoo/task.rb
Instance Attribute Summary collapse
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#todo ⇒ Object
Returns the value of attribute todo.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(todo, priority = 0) ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(todo, priority = 0) ⇒ Task
Returns a new instance of Task.
5 6 7 8 |
# File 'lib/rudoo/task.rb', line 5 def initialize(todo, priority = 0) @todo = todo @priority = priority end |
Instance Attribute Details
#priority ⇒ Object
Returns the value of attribute priority.
3 4 5 |
# File 'lib/rudoo/task.rb', line 3 def priority @priority end |
#todo ⇒ Object
Returns the value of attribute todo.
3 4 5 |
# File 'lib/rudoo/task.rb', line 3 def todo @todo end |
Instance Method Details
#id ⇒ Object
10 11 12 13 |
# File 'lib/rudoo/task.rb', line 10 def id return Digest::SHA1.hexdigest(@todo)[0,6] unless @todo.nil? return nil if @todo.nil? end |