Class: Pompom::Worklog

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Worklog

Returns a new instance of Worklog.



59
60
61
62
# File 'lib/pompom.rb', line 59

def initialize(path)
  @path = File.expand_path(path)
  @directory = File.dirname(@path)
end

Instance Method Details

#finish_earlyObject



69
70
71
# File 'lib/pompom.rb', line 69

def finish_early
  @db[:pomodoros].where(:id => @id).update(:finished_early => true)
end

#start(pomodoro) ⇒ Object



64
65
66
67
# File 'lib/pompom.rb', line 64

def start(pomodoro)
  ensure_present
  @id = @db[:pomodoros].insert(:started_at => Time.now, :message => pomodoro.message, :finished_early => false)
end