Basic object containing a committed and not-committed hour count, with some simple related helper methods.
Clients manipulate the committed/not-committed values directly. They’re BigDecimals starting at zero. Higher levels of abstraction cause too great a performance hit.
# File lib/track_record_report.rb, line 100 def initialize @committed = @not_committed = BigDecimal.new( 0 ) end
Returns ‘true’ if the object records > 0 total hours, else ‘false’.
# File lib/track_record_report.rb, line 112 def has_hours? return ( total() > BigDecimal.new( 0 ) ) end
Returns total worked hours (committed plus not committed).
# File lib/track_record_report.rb, line 106 def total return ( @committed + @not_committed ) end