Class QBFC::Reports::Rows
In: lib/qbfc/reports/rows.rb
Parent: Array

Methods

[]   get_row   parse  

Public Class methods

[Source]

    # File lib/qbfc/reports/rows.rb, line 5
 5:         def get_row(cols)
 6:           ret = []
 7:           if cols
 8:             cols.each do |col|
 9:               ret << col.value.getValue
10:             end
11:           end
12:           ret
13:         end

[Source]

    # File lib/qbfc/reports/rows.rb, line 15
15:         def parse(report_data)
16:           data = []
17:           subtotals = []
18:           totals = []
19:           text = []
20:           
21:           report_data.o_r_report_datas.each do |d|
22:             if d.DataRow
23:               data << get_row(d.DataRow.col_datas)
24:             elsif d.TextRow
25:               text << d.TextRow.value.getValue
26:             elsif d.SubtotalRow
27:               subtotals << get_row(d.SubtotalRow.col_datas)
28:             elsif d.TotalRow
29:               totals << get_row(d.TotalRow.col_datas)
30:             end
31:   
32:           end
33:           
34:           return {:data => new(data), 
35:                   :subtotals => new(subtotals),
36:                   :text => text,
37:                   :totals => new(totals)}
38:         end

Public Instance methods

[Source]

    # File lib/qbfc/reports/rows.rb, line 41
41:       def [](value)
42:         if value.kind_of? String
43:           self.detect{ |entry| entry[0] == value }
44:         else
45:           super
46:         end
47:       end

[Validate]