A Row stores an array of Cells accessed by a date-based key of the caller’s choosing (just be consistent in your choices). It maintains its own running totals of the amounts in its cells, complete with per-user totals for the contributions to the row.
# File lib/track_record_report.rb, line 158 def initialize super() task_actual_remaining = task_potential_remaining = BigDecimal.new( 0 ) @cells = {} end
Return the Cell for the given date-based key, or ‘nil’ if there is no such cell record for this row.
# File lib/track_record_report.rb, line 168 def cell( date_based_key ) @cells[ date_based_key ] end
Return the Cell for the given date-based key, lazy-creating a new instance if need be.
# File lib/track_record_report.rb, line 175 def cell!( date_based_key ) @cells[ date_based_key ] ||= Cell.new end
Returns ‘true’ if there are any cells on this row, else ‘false’.
# File lib/track_record_report.rb, line 181 def has_cells? not @cells.empty? end