lib/reportbuilder.rb in reportbuilder-1.0.0 vs lib/reportbuilder.rb in reportbuilder-1.1.0
- old
+ new
@@ -49,11 +49,11 @@
# Name of report
attr_accessor :name
# Doesn't print a title if set to true
attr_accessor :no_title
- VERSION = '1.0.0'
+ VERSION = '1.1.0'
# Generates and optionally save the report on one function
def self.generate(options=Hash.new, &block)
options[:filename]||=nil
options[:format]||="text"
@@ -98,9 +98,21 @@
# Returns an Html output
def to_html()
gen = Generator::Html.new(self,@options)
gen.parse
gen.out
+ end
+ # Returns a RTF output
+ def to_rtf()
+ gen = Generator::Rtf.new(self,@options)
+ gen.parse
+ gen.out
+ end
+ # Save a rtf file
+ def save_rtf(filename)
+ gen = Generator::Rtf.new(self,@options)
+ gen.parse
+ gen.save(filename)
end
# Save an html file
def save_html(file)
options=@options.dup
options[:directory]=File.dirname(file)