class Project

Public Instance Methods

total_earned() click to toggle source
# File lib/kale/project.rb, line 10
def total_earned
  "$" + sprintf("%.2f", self.rate_per_hour.to_f * (total_time.to_f / 3600))
end
total_time() click to toggle source
# File lib/kale/project.rb, line 5
def total_time
  times = self.sessions.collect { |s| s[:elapsed_time] }
  times.inject{ |sum,x| sum + x }
end