Class: Pompom::Worklog
- Inherits:
-
Object
- Object
- Pompom::Worklog
- Defined in:
- lib/pompom.rb
Instance Method Summary collapse
- #finish_early ⇒ Object
-
#initialize(path) ⇒ Worklog
constructor
A new instance of Worklog.
- #start(pomodoro) ⇒ Object
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.(path) @directory = File.dirname(@path) end |
Instance Method Details
#finish_early ⇒ Object
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., :finished_early => false) end |