class TrackRecordReport::Row

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.

Public Class Methods

new() click to toggle source
# File lib/track_record_report.rb, line 158
def initialize
  super()

  task_actual_remaining = task_potential_remaining = BigDecimal.new( 0 )
  @cells = {}
end

Public Instance Methods

cell( date_based_key ) click to toggle source

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
cell!( date_based_key ) click to toggle source

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
has_cells?() click to toggle source

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