class Tyme::Manager

Public Class Methods

new( db_path = nil, last_output = nil ) click to toggle source
# File lib/tyme/manager.rb, line 6
def initialize( db_path = nil, last_output = nil )
  @db = db_path ? Db.new(db_path) : Db.new
  @last = last_output ? Last.new(last_output) : Last.new
end

Public Instance Methods

run() click to toggle source
# File lib/tyme/manager.rb, line 11
def run
  @last.process.each do |user, value|
    value.each do |date, duration|
      @db.add_entry( user, date, duration )
    end
  end
  @db.save
end