From 407b884ef349d6dec12f50006ea6268c96205a83 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 27 Nov 2011 21:34:48 +0900 Subject: adding yields for package workbook, workbook styles and cols collection on worksheet to make charting easier. --- doc/Axlsx/Workbook.html | 605 ++++++++++++++++++++++-------------------------- 1 file changed, 281 insertions(+), 324 deletions(-) (limited to 'doc/Axlsx/Workbook.html') diff --git a/doc/Axlsx/Workbook.html b/doc/Axlsx/Workbook.html index ffb0522c..27c67ec0 100644 --- a/doc/Axlsx/Workbook.html +++ b/doc/Axlsx/Workbook.html @@ -94,33 +94,31 @@

Overview

-

-The Workbook class is an xlsx workbook that manages worksheets, charts, + +

The Workbook class is an xlsx workbook that manages worksheets, charts, drawings and styles. The following parts of the Office Open XML spreadsheet -specification are not implimented in this version. -

-
-  bookViews
-  calcPr
-  customWorkbookViews
-  definedNames
-  externalReferences
-  extLst
-  fileRecoveryPr
-  fileSharing
-  fileVersion
-  functionGroups
-  oleSize
-  pivotCaches
-  smartTagPr
-  smartTagTypes
-  webPublishing
-  webPublishObjects
-  workbookProtection
-  workbookPr*
-
-  *workbookPr is only supported to the extend of date1904
-
+specification are not implimented in this version.

+ +
bookViews
+calcPr
+customWorkbookViews
+definedNames
+externalReferences
+extLst
+fileRecoveryPr
+fileSharing
+fileVersion
+functionGroups
+oleSize
+pivotCaches
+smartTagPr
+smartTagTypes
+webPublishing
+webPublishObjects
+workbookProtection
+workbookPr*
+
+*workbookPr is only supported to the extend of date1904
@@ -136,10 +134,9 @@ specification are not implimented in this version.
@@date1904 =
-

-Indicates if the epoc date for serialization should be 1904. If false, 1900 -is used. -

+ +

Indicates if the epoc date for serialization should be 1904. If false, 1900 +is used.

@@ -149,8 +146,7 @@ is used.
-
false
-
+
false
@@ -178,9 +174,8 @@ is used. -

-A colllection of charts associated with this workbook. -

+
+

A colllection of charts associated with this workbook.

@@ -205,9 +200,8 @@ A colllection of charts associated with this workbook. -

-A colllection of drawings associated with this workbook. -

+
+

A colllection of drawings associated with this workbook.

@@ -232,36 +226,8 @@ A colllection of drawings associated with this workbook. -

-A colllection of images associated with this workbook. -

-
- - - - -
  • - - - - (Styles) styles - - - - - - - readonly - - - - - - - - -

    -The styles associated with this workbook. -

    +
    +

    A colllection of images associated with this workbook.

  • @@ -286,9 +252,8 @@ The styles associated with this workbook. -

    -A collection of worksheets associated with this workbook. -

    +
    +

    A collection of worksheets associated with this workbook.

    @@ -323,9 +288,8 @@ A collection of worksheets associated with this workbook. -

    -retrieves the date1904 attribute. -

    +
    +

    retrieves the date1904 attribute.

    @@ -347,9 +311,8 @@ retrieves the date1904 attribute. -

    -Sets the date1904 attribute to the provided boolean. -

    +
    +

    Sets the date1904 attribute to the provided boolean.

    @@ -380,9 +343,8 @@ Sets the date1904 attribute to the provided boolean. -

    -Adds a worksheet to this workbook. -

    +
    +

    Adds a worksheet to this workbook.

    @@ -404,9 +366,8 @@ Adds a worksheet to this workbook. -

    -Instance level access to the class variable 1904. -

    +
    +

    Instance level access to the class variable 1904.

    @@ -428,9 +389,8 @@ Instance level access to the class variable 1904. -

    -see @date1904. -

    +
    +

    see @date1904.

    @@ -454,9 +414,8 @@ see @date1904. -

    -Creates a new Workbook. -

    +
    +

    Creates a new Workbook.

    @@ -478,9 +437,31 @@ Creates a new Workbook. -

    -The workbook relationships. -

    +
    +

    The workbook relationships.

    +
    + + + + +
  • + + + - (Styles) styles {|@styles| ... } + + + + + + + + + + + + +
    +

    The styles associated with this workbook.

  • @@ -502,9 +483,8 @@ The workbook relationships. -

    -Serializes the workbook document. -

    +
    +

    Serializes the workbook document.

    @@ -525,9 +505,8 @@ Serializes the workbook document.

    -

    -Creates a new Workbook -

    + +

    Creates a new Workbook

    @@ -548,9 +527,8 @@ Creates a new Workbook — -

    -a customizable set of options -

    +
    +

    a customizable set of options

    @@ -601,9 +579,8 @@ a customizable set of options — -

    -the object that the method was called on -

    +
    +

    the object that the method was called on

    @@ -616,29 +593,28 @@ the object that the method was called on
     
     
    -75
    -76
     77
     78
     79
     80
     81
     82
    -83
    +83 +84 +85 -
    # File 'lib/axlsx/workbook/workbook.rb', line 75
    -
    -def initialize(options={})
    -  @styles = Styles.new
    -  @worksheets = SimpleTypedList.new Worksheet
    -  @drawings = SimpleTypedList.new Drawing
    -  @charts = SimpleTypedList.new Chart
    -  @images = SimpleTypedList.new Pic
    -  self.date1904= options[:date1904] unless options[:date1904].nil?
    -  yield self if block_given?      
    -end
    -
    +
    # File 'lib/axlsx/workbook/workbook.rb', line 77
    +
    +def initialize(options={})
    +  @styles = Styles.new
    +  @worksheets = SimpleTypedList.new Worksheet
    +  @drawings = SimpleTypedList.new Drawing
    +  @charts = SimpleTypedList.new Chart
    +  @images = SimpleTypedList.new Pic
    +  self.date1904= options[:date1904] unless options[:date1904].nil?
    +  yield self if block_given?      
    +end
    @@ -664,15 +640,13 @@ the object that the method was called on
    Note: -

    -The recommended way to manage charts is Worksheet#add_chart -

    +
    +

    The recommended way to manage charts is Worksheet#add_chart

    -

    -A colllection of charts associated with this workbook -

    + +

    A colllection of charts associated with this workbook

    @@ -715,10 +689,9 @@ A colllection of charts associated with this workbook
    # File 'lib/axlsx/workbook/workbook.rb', line 45
     
    -def charts
    -  @charts
    -end
    -
    +def charts + @charts +end @@ -739,15 +712,13 @@ A colllection of charts associated with this workbook
    Note: -

    -The recommended way to manage drawings is Worksheet#add_chart -

    +
    +

    The recommended way to manage drawings is Worksheet#add_chart

    -

    -A colllection of drawings associated with this workbook -

    + +

    A colllection of drawings associated with this workbook

    @@ -790,10 +761,9 @@ A colllection of drawings associated with this workbook
    # File 'lib/axlsx/workbook/workbook.rb', line 59
     
    -def drawings
    -  @drawings
    -end
    -
    +def drawings + @drawings +end @@ -814,15 +784,13 @@ A colllection of drawings associated with this workbook
    Note: -

    -The recommended way to manage images is Worksheet#add_image -

    +
    +

    The recommended way to manage images is Worksheet#add_image

    -

    -A colllection of images associated with this workbook -

    + +

    A colllection of images associated with this workbook

    @@ -865,85 +833,9 @@ A colllection of images associated with this workbook
    # File 'lib/axlsx/workbook/workbook.rb', line 52
     
    -def images
    -  @images
    -end
    -
    - - - -
    - - - - -
    -

    - - - (Styles) styles (readonly) - - - -

    -
    - -
    - Note: -

    -The recommended way to manage styles is Styles#add_style -

    -
    -
    - -

    -The styles associated with this workbook -

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (Styles) - - - -
    • - -
    - -

    See Also:

    -
      - -
    • Style#add_style
    • - -
    • Style
    • - -
    - -
    - - -
    -
    -
    -
    -66
    -67
    -68
    -
    -
    # File 'lib/axlsx/workbook/workbook.rb', line 66
    -
    -def styles
    -  @styles
    -end
    -
    +def images + @images +end
    @@ -964,15 +856,13 @@ The styles associated with this workbook
    Note: -

    -The recommended way to manage worksheets is add_worksheet -

    +
    +

    The recommended way to manage worksheets is add_worksheet

    -

    -A collection of worksheets associated with this workbook. -

    + +

    A collection of worksheets associated with this workbook.

    @@ -1015,10 +905,9 @@ A collection of worksheets associated with this workbook.
    # File 'lib/axlsx/workbook/workbook.rb', line 38
     
    -def worksheets
    -  @worksheets
    -end
    -
    +def worksheets + @worksheets +end @@ -1040,9 +929,8 @@ A collection of worksheets associated with this workbook.

    -

    -retrieves the date1904 attribute -

    + +

    retrieves the date1904 attribute

    @@ -1069,13 +957,12 @@ retrieves the date1904 attribute
     
     
    -98
    +100 -
    # File 'lib/axlsx/workbook/workbook.rb', line 98
    +      
    # File 'lib/axlsx/workbook/workbook.rb', line 100
     
    -def self.date1904() @@date1904; end
    -
    +def self.date1904() @@date1904; end
    @@ -1090,9 +977,8 @@ retrieves the date1904 attribute

    -

    -Sets the date1904 attribute to the provided boolean -

    + +

    Sets the date1904 attribute to the provided boolean

    @@ -1119,13 +1005,12 @@ Sets the date1904 attribute to the provided boolean
     
     
    -94
    +96 -
    # File 'lib/axlsx/workbook/workbook.rb', line 94
    +      
    # File 'lib/axlsx/workbook/workbook.rb', line 96
     
    -def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v end
    -
    +def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
    @@ -1146,9 +1031,8 @@ Sets the date1904 attribute to the provided boolean

    -

    -Adds a worksheet to this workbook -

    + +

    Adds a worksheet to this workbook

    @@ -1169,9 +1053,8 @@ Adds a worksheet to this workbook — -

    -a customizable set of options -

    +
    +

    a customizable set of options

    @@ -1190,9 +1073,8 @@ a customizable set of options - —

    -The name of the worksheet. -

    + —
    +

    The name of the worksheet.

    @@ -1239,21 +1121,20 @@ The name of the worksheet.
     
     
    -104
    -105
     106
     107
    -108
    +108 +109 +110 -
    # File 'lib/axlsx/workbook/workbook.rb', line 104
    -
    -def add_worksheet(options={})
    -  worksheet = Worksheet.new(self, options)
    -  yield worksheet if block_given?
    -  worksheet
    -end
    -
    +
    # File 'lib/axlsx/workbook/workbook.rb', line 106
    +
    +def add_worksheet(options={})
    +  worksheet = Worksheet.new(self, options)
    +  yield worksheet if block_given?
    +  worksheet
    +end
    @@ -1268,9 +1149,8 @@ The name of the worksheet.

    -

    -Instance level access to the class variable 1904 -

    + +

    Instance level access to the class variable 1904

    @@ -1297,13 +1177,12 @@ Instance level access to the class variable 1904
     
     
    -87
    +89 -
    # File 'lib/axlsx/workbook/workbook.rb', line 87
    +      
    # File 'lib/axlsx/workbook/workbook.rb', line 89
     
    -def date1904() @@date1904; end
    -
    +def date1904() @@date1904; end
    @@ -1318,9 +1197,8 @@ Instance level access to the class variable 1904

    -

    -see @date1904 -

    + +

    see @date1904

    @@ -1334,13 +1212,12 @@ see @date1904
     
     
    -90
    +92 -
    # File 'lib/axlsx/workbook/workbook.rb', line 90
    +      
    # File 'lib/axlsx/workbook/workbook.rb', line 92
     
    -def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v end
    -
    +def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
    @@ -1355,9 +1232,8 @@ see @date1904

    -

    -The workbook relationships. This is managed automatically by the workbook -

    + +

    The workbook relationships. This is managed automatically by the workbook

    @@ -1384,27 +1260,110 @@ The workbook relationships. This is managed automatically by the workbook
     
     
    -112
    -113
     114
     115
     116
     117
     118
    -119
    +119 +120 +121 + + +
    # File 'lib/axlsx/workbook/workbook.rb', line 114
    +
    +def relationships
    +  r = Relationships.new
    +  @worksheets.each do |sheet|
    +    r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1))
    +  end 
    +  r << Relationship.new(STYLES_R,  STYLES_PN)
    +  r
    +end
    + + + +
    + +
    +

    + + - (Styles) styles {|@styles| ... } + + + +

    +
    + +
    + Note: +
    +

    The recommended way to manage styles is Styles#add_style

    +
    +
    + + +

    The styles associated with this workbook

    + + +
    +
    +
    + +

    Yields:

    +
      + +
    • + + + (@styles) + + + +
    • + +
    +

    Returns:

    +
      + +
    • + + + (Styles) + + + +
    • + +
    + +

    See Also:

    +
      + +
    • Style#add_style
    • + +
    • Style
    • + +
    + +
    + +
    +
    +
    +
    +66
    +67
    +68
    +69
    -
    # File 'lib/axlsx/workbook/workbook.rb', line 112
    -
    -def relationships
    -  r = Relationships.new
    -  @worksheets.each do |sheet|
    -    r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1))
    -  end 
    -  r << Relationship.new(STYLES_R,  STYLES_PN)
    -  r
    -end
    -
    +
    # File 'lib/axlsx/workbook/workbook.rb', line 66
    +
    +def styles
    +  yield @styles if block_given?
    +  @styles
    +end
    @@ -1419,9 +1378,8 @@ The workbook relationships. This is managed automatically by the workbook

    -

    -Serializes the workbook document -

    + +

    Serializes the workbook document

    @@ -1448,8 +1406,6 @@ Serializes the workbook document
     
     
    -123
    -124
     125
     126
     127
    @@ -1461,26 +1417,27 @@ Serializes the workbook document
     133
     134
     135
    -136
    +136 +137 +138 -
    # File 'lib/axlsx/workbook/workbook.rb', line 123
    -
    -def to_xml()
    -  add_worksheet unless worksheets.size > 0
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.workbook(:xmlns => XML_NS, :'xmlns:r' => XML_NS_R) {
    -      xml.workbookPr(:date1904=>@@date1904)
    -      xml.sheets {
    -        @worksheets.each_with_index do |sheet, index|              
    -          xml.sheet(:name=>sheet.name, :sheetId=>index+1, :"r:id"=>sheet.rId)
    -        end
    -      }
    -    }
    -  end      
    -  builder.to_xml(:indent=>0)
    -end
    -
    +
    # File 'lib/axlsx/workbook/workbook.rb', line 125
    +
    +def to_xml()
    +  add_worksheet unless worksheets.size > 0
    +  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    +    xml.workbook(:xmlns => XML_NS, :xmlns:r' => XML_NS_R) {
    +      xml.workbookPr(:date1904=>@@date1904)
    +      xml.sheets {
    +        @worksheets.each_with_index do |sheet, index|              
    +          xml.sheet(:name=>sheet.name, :sheetId=>index+1, :r:id"=>sheet.rId)
    +        end
    +      }
    +    }
    +  end      
    +  builder.to_xml(:indent=>0)
    +end
    @@ -1491,9 +1448,9 @@ Serializes the workbook document
    -- cgit v1.2.3