lib/reportbuilder.rb in reportbuilder-1.2.2 vs lib/reportbuilder.rb in reportbuilder-1.2.3
- old
+ new
@@ -6,31 +6,29 @@
# = Report Abstract Interface.
# Creates text, html and rtf output, based on a common framework.
#
# == Use
#
+# 1) Using generic ReportBuilder#add, every object will be parsed using methods report_building_FORMAT, #report_building or #to_s
#
-# * Using generic ReportBuilder#add, every object will be parsed using #report_building_FORMAT, #report_building or #to_s
-#
# require "reportbuilder"
# rb=ReportBuilder.new
# rb.add(2) # Int#to_s used
# section=ReportBuilder::Section.new(:name=>"Section 1")
# table=ReportBuilder::Table.new(:name=>"Table", :header=>%w{id name})
# table.row([1,"John"])
# table.hr
# table.row([2,"Peter"])
-#
# section.add(table) # Section is a container for other methods
# rb.add(section) # table have a #report_building method
# rb.add("Another text") # used directly
# rb.name="Text output"
# puts rb.to_text
# rb.name="Html output"
# puts rb.to_html
#
-# * Using a block, you can control directly the builder
+# 2) Using a block, you can control directly the builder
#
# require "reportbuilder"
# rb=ReportBuilder.new do
# text("2")
# section(:name=>"Section 1") do
@@ -51,10 +49,10 @@
# Name of report
attr_accessor :name
# Doesn't print a title if set to true
attr_accessor :no_title
# ReportBuilder version
- VERSION = '1.2.2'
+ VERSION = '1.2.3'
FormatNotFound=Class.new(Exception)
# Available formats
def self.builder_for(format)
format=format.to_s.downcase