Class: Rudoo::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/rudoo/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#priorityObject

Returns the value of attribute priority.



3
4
5
# File 'lib/rudoo/task.rb', line 3

def priority
  @priority
end

#todoObject

Returns the value of attribute todo.



3
4
5
# File 'lib/rudoo/task.rb', line 3

def todo
  @todo
end

Instance Method Details

#idObject



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