lib/dspace_db_coll_info.rb
############################################################################
# Generate a CSV (or other delimited) report. Return as a string.
Generate a CSV (or other delimited) report. Return as a string.
Generate a CSV ( or other delimited ) report . Return as a string .
def report_to_s(report_key, with_header=true)
    lines = []
    rinfo = REPORT_INFO[report_key]
    lines << rinfo[:columns].join(FIELD_DELIM) if with_header
    @reports[report_key].each{|row|
      lines << rinfo[:columns].inject([]){|a,f| a << row[f]; a}.join(FIELD_DELIM)
    }
    lines.join(LINE_DELIM) + LINE_DELIM
  end
def report_to_s ( report_key , with_header = true ) lines = [ ] rinfo = REPORT_INFO [ report_key ] lines << rinfo [ :columns ] . join ( FIELD_DELIM ) if with_header @reports [ report_key ] . each { | row | lines << rinfo [ :columns ] . inject ( [ ] ) { | a , f | a << row [ f ] ; a } . join ( FIELD_DELIM ) } lines . join ( LINE_DELIM ) + LINE_DELIM end
Generate a CSV (or other delimited) report.
Generate a CSV ( or other delimited ) report .
report_key
<not_specific>
with_header
<not_specific>