Method: TimeTrackr::Database#history
- Defined in:
- lib/timetrackr/database.rb
#history(task, p_begin = nil, p_end = nil) ⇒ Object
get task history as an array of Periods
69 70 71 72 73 |
# File 'lib/timetrackr/database.rb', line 69 def history(task, p_begin=nil, p_end=nil) @db[:tasks][task].sort{|x,y| x[:start] <=> y[:start]}.collect {|p| Period.new(task,p[:start],p[:stop],p[:notes]) } unless !@db[:tasks].include? task end |