From 058faf2581970fa18c314ad07f5658adeca32c69 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 27 Nov 2011 22:08:55 +0900 Subject: update to README --- doc/Axlsx/Ar/SingletonMethods.html | 108 ++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 50 deletions(-) (limited to 'doc/Axlsx/Ar/SingletonMethods.html') diff --git a/doc/Axlsx/Ar/SingletonMethods.html b/doc/Axlsx/Ar/SingletonMethods.html index f1081b17..f3752b7b 100644 --- a/doc/Axlsx/Ar/SingletonMethods.html +++ b/doc/Axlsx/Ar/SingletonMethods.html @@ -79,9 +79,8 @@

Overview

-

-Singleton methods for the mixin -

+ +

Singleton methods for the mixin

@@ -118,9 +117,8 @@ Singleton methods for the mixin -

-Maps the AR class to an Axlsx package options are passed into AR find. -

+
+

Maps the AR class to an Axlsx package options are passed into AR find.

@@ -144,9 +142,8 @@ Maps the AR class to an Axlsx package options are passed into AR find.

-

-Maps the AR class to an Axlsx package options are passed into AR find -

+ +

Maps the AR class to an Axlsx package options are passed into AR find

@@ -155,6 +152,22 @@ Maps the AR class to an Axlsx package options are passed into AR find

Parameters:

    +
  • + + Symbol, + + + (Symbol, :all, etc.) + + + + — +
    +

    :all, etc.

    +
    + +
  • +
  • options @@ -167,9 +180,8 @@ Maps the AR class to an Axlsx package options are passed into AR find — -

    -a customizable set of options -

    +
    +

    a customizable set of options

  • @@ -190,9 +202,8 @@ a customizable set of options - —

    -to apply to the first row of field names -

    + —
    +

    to apply to the first row of field names

    @@ -202,10 +213,9 @@ to apply to the first row of field names - —

    -array of Axlsx types for each cell in data rows or a single type that will -be applied to all types. -

    + —
    +

    array of Axlsx types for each cell in data rows or a single type that will +be applied to all types.

    @@ -215,9 +225,8 @@ be applied to all types. - —

    -The style to pass to Worksheet#add_row -

    + —
    +

    The style to pass to Worksheet#add_row

    @@ -238,7 +247,6 @@ The style to pass to Worksheet#add_row
     
     
    -31
     32
     33
     34
    @@ -258,33 +266,33 @@ The style to pass to Worksheet#add_row
     48
     49
     50
    -51
    +51 +52 -
    # File 'lib/axlsx/ar.rb', line 31
    -
    -def to_xlsx(number = :all, options = {})
    -  row_style = options.delete(:style)
    -  header_style = options.delete(:header_style) || row_style
    -  types = options.delete(:types)
    -
    -  data = [*find(number, options)]
    -  data.compact!
    -  data.flatten!
    -  columns = data.first.attributes.keys
    -  p = Package.new
    -  row_style = p.workbook.styles.add_style(row_style) unless row_style.nil?
    -  header_style = p.workbook.styles.add_style(header_style) unless header_style.nil?
    -  
    -  p.workbook.add_worksheet(:name=>table_name.humanize) do |sheet|
    -    sheet.add_row columns, :style=>header_style
    -    data.each do |r|
    -      sheet.add_row r.attributes.values, :style=>row_style, :types=>types
    -    end
    -  end
    -  p
    -end
    -
    +
    # File 'lib/axlsx/ar.rb', line 32
    +
    +def to_xlsx(number = :all, options = {})
    +  row_style = options.delete(:style)
    +  header_style = options.delete(:header_style) || row_style
    +  types = options.delete(:types)
    +
    +  data = [*find(number, options)]
    +  data.compact!
    +  data.flatten!
    +  columns = data.first.attributes.keys
    +  p = Package.new
    +  row_style = p.workbook.styles.add_style(row_style) unless row_style.nil?
    +  header_style = p.workbook.styles.add_style(header_style) unless header_style.nil?
    +  
    +  p.workbook.add_worksheet(:name=>table_name.humanize) do |sheet|
    +    sheet.add_row columns, :style=>header_style
    +    data.each do |r|
    +      sheet.add_row r.attributes.values, :style=>row_style, :types=>types
    +    end
    +  end
    +  p
    +end
    @@ -295,9 +303,9 @@ The style to pass to Worksheet#add_row
    -- cgit v1.2.3