lib/writeexcel/workbook.rb in writeexcel-0.4.1 vs lib/writeexcel/workbook.rb in writeexcel-0.4.2

- old
+ new

@@ -68,11 +68,11 @@ # def initialize(file, default_formats = {}) super() @file = file @default_formats = default_formats - @parser = Formula.new(@byte_order) + @parser = Writeexcel::Formula.new(@byte_order) @tempdir = nil @date_1904 = false @sheet = @selected = 0 @@ -303,11 +303,11 @@ @date_1904, @compatibility, nil, # Palette. Not used yet. See add_chart(). @sinfo, ] - worksheet = Worksheet.new(*init_data) + worksheet = Writeexcel::Worksheet.new(*init_data) @worksheets[index] = worksheet # Store ref for iterator @sheetnames[index] = name # Store EXTERNSHEET names @parser.set_ext_sheets(name, index) # Store names in Formula.rb worksheet end @@ -320,11 +320,11 @@ # # This method is use to create a new chart either as a standalone worksheet # (the default) or as an embeddable object that can be inserted into a # worksheet via the insert_chart() Worksheet method. # - # chart = workbook.add_chart(:type => Chart::Column) + # chart = workbook.add_chart(:type => 'Chart::Column') # # The properties that can be set are: # # :type (required) # :name (optional) @@ -332,42 +332,42 @@ # # * type # # This is a required parameter. It defines the type of chart that will be created. # - # chart = workbook.add_chart(:type => Chart::Line) + # chart = workbook.add_chart(:type => 'Chart::Line') # # The available types are: # - # Chart::Column - # Chart::Bar - # Chart::Line - # Chart::Area - # Chart::Pie - # Chart::Scatter - # Chart::Stock + # 'Chart::Column' + # 'Chart::Bar' + # 'Chart::Line' + # 'Chart::Area' + # 'Chart::Pie' + # 'Chart::Scatter' + # 'Chart::Stock' # # * :name # # Set the name for the chart sheet. The name property is optional and # if it isn't supplied will default to Chart1 .. n. The name must be # a valid Excel worksheet name. See add_worksheet() for more details # on valid sheet names. The name property can be omitted for embedded # charts. # # chart = workbook.add_chart( - # :type => Chart::Line, + # :type => 'Chart::Line', # :name => 'Results Chart' # ) # # * :embedded # # Specifies that the Chart object will be inserted in a worksheet via # the insert_chart() Worksheet method. It is an error to try insert a # Chart that doesn't have this flag set. # - # chart = workbook.add_chart(:type => Chart::Line, :embedded => 1) + # chart = workbook.add_chart(:type => 'Chart::Line', :embedded => 1) # # # Configure the chart. # ... # # # Insert the chart into the a worksheet. @@ -405,11 +405,11 @@ @compatibility, @palette, @sinfo ] - chart = Chart.factory(type, *init_data) + chart = Writeexcel::Chart.factory(type, *init_data) # If the chart isn't embedded let the workbook control it. if !embedded @worksheets[index] = chart # Store ref for iterator @sheetnames[index] = name # Store EXTERNSHEET names else @@ -449,11 +449,11 @@ index, encoding, @sinfo ] - chart = Chart.factory(self, type, init_data) + chart = Writeexcel::Chart.factory(self, type, init_data) @worksheets[index] = chart # Store ref for iterator @sheetnames[index] = name # Store EXTERNSHEET names chart end @@ -575,11 +575,11 @@ # See the "CELL FORMATTING" section for more details about Format properties and how to set them. # def add_format(*args) formats = {} args.each { |arg| formats = formats.merge(arg) } - format = Format.new(@xf_index, @default_formats.merge(formats)) + format = Writeexcel::Format.new(@xf_index, @default_formats.merge(formats)) @xf_index += 1 @formats.push format # Store format reference format end @@ -1689,40 +1689,40 @@ # Add the default fonts for charts and comments. This aren't connected # to XF formats. Note, the font size, and some other properties of # chart fonts are set in the FBI record of the chart. # Index 5. Axis numbers. - tmp_format = Format.new( + tmp_format = Writeexcel::Format.new( nil, :font_only => 1 ) append(tmp_format.get_font) # Index 6. Series names. - tmp_format = Format.new( + tmp_format = Writeexcel::Format.new( nil, :font_only => 1 ) append(tmp_format.get_font) # Index 7. Title. - tmp_format = Format.new( + tmp_format = Writeexcel::Format.new( nil, :font_only => 1, :bold => 1 ) append(tmp_format.get_font) # Index 8. Axes. - tmp_format = Format.new( + tmp_format = Writeexcel::Format.new( nil, :font_only => 1, :bold => 1 ) append(tmp_format.get_font) # Index 9. Comments. - tmp_format = Format.new( + tmp_format = Writeexcel::Format.new( nil, :font_only => 1, :font => 'Tahoma', :size => 8 )