Class: Wizport::Builder::Rtf
- Inherits:
-
Object
- Object
- Wizport::Builder::Rtf
- Defined in:
- lib/wizport/builder/rtf.rb
Instance Method Summary collapse
- #footer ⇒ Object
- #header ⇒ Object
-
#initialize(report) ⇒ Rtf
constructor
A new instance of Rtf.
- #save(file) ⇒ Object
- #section(section) ⇒ Object
- #section_body(section, group) ⇒ Object
- #section_footer(section, group) ⇒ Object
- #section_header(section, group) ⇒ Object
Constructor Details
Instance Method Details
#footer ⇒ Object
46 47 48 |
# File 'lib/wizport/builder/rtf.rb', line 46 def end |
#header ⇒ Object
14 15 16 |
# File 'lib/wizport/builder/rtf.rb', line 14 def header @rtf.text @rpt.title end |
#save(file) ⇒ Object
50 51 52 |
# File 'lib/wizport/builder/rtf.rb', line 50 def save(file) @rtf.save(file) end |
#section(section) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/wizport/builder/rtf.rb', line 18 def section(section) @tbl = [] @rpt.source.groups(section).each do |group| section_header(section, group) section_body(section, group) (section, group) end @rtf.table @tbl end |
#section_body(section, group) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/wizport/builder/rtf.rb', line 32 def section_body(section, group) #rows = [] #rows << @rpt.columns.map { |c| c.title } #objs = @rpt.source.filter({section.group => group}) #objs.each do |obj| # rows << @rpt.columns.map { |c| obj.send(c.name) } #end #@tbl << [@rtf.make_table(rows)] end |
#section_footer(section, group) ⇒ Object
42 43 44 |
# File 'lib/wizport/builder/rtf.rb', line 42 def (section, group) end |
#section_header(section, group) ⇒ Object
28 29 30 |
# File 'lib/wizport/builder/rtf.rb', line 28 def section_header(section, group) @tbl << ["#{section.title}:#{group}"] end |