Class: Project
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- Project
- Defined in:
- lib/kale/project.rb
Instance Method Summary collapse
Instance Method Details
#total_earned ⇒ Object
10 11 12 |
# 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 ⇒ Object
5 6 7 8 |
# 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 |