class TrackRecordReport::ReportRow

Store information about a specific task over a full report date range. The parent report contains information about that range.

Attributes

cells[R]

Array of ReportCell objects

task[R]

Task for which this row exists

user_row_totals[R]

Array of ReportUserRowTotal objects

Public Class Methods

new( task ) click to toggle source
# File lib/track_record_report.rb, line 993
def initialize( task )
  super()
  @cells           = []
  @user_row_totals = []
  @task            = task
end

Public Instance Methods

add_cell( cell ) click to toggle source

Add the given ReportCell object to the “@cells” array and increment the internal running total for the row.

# File lib/track_record_report.rb, line 1003
def add_cell( cell )
  @cells.push( cell )
  add!( cell )
end
add_user_row_total( user_row_total ) click to toggle source

Call to add ReportUserRowTotal objects to the row’s @#user_row_totals array.

# File lib/track_record_report.rb, line 1018
def add_user_row_total( user_row_total )
  @user_row_totals.push( user_row_total )
end
delete_cell( index ) click to toggle source

Delete a ReportCell object from the “@cells” array at the given index.

# File lib/track_record_report.rb, line 1010
def delete_cell( index )
  subtract!( @cells[ index ] )
  @cells.delete_at( index )
end
delete_user_row_total( index ) click to toggle source

Call to delete a row total from a specific index.

# File lib/track_record_report.rb, line 1024
def delete_user_row_total( index )
  @user_row_totals.delete_at( index )
end