Method: Axlsx::Package#initialize

Defined in:
lib/axlsx/package.rb

#initialize(options = {}) {|_self| ... } ⇒ Package

Initializes your package

Examples:

Package.new :author => 'you!', :workbook => Workbook.new


Parameters:

  • options (Hash) (defaults to: {})

    A hash that you can use to specify the author and workbook for this package.

Options Hash (options):

  • :author (String)

    The author of the document

  • :created_at (Time)

    Timestamp in the document properties (defaults to current time).

  • :use_shared_strings (Boolean)

    This is passed to the workbook to specify that shared strings should be used when serializing the package.

Yields:

  • (_self)

Yield Parameters:



23
24
25
26
27
28
29
30
# File 'lib/axlsx/package.rb', line 23

def initialize(options={})
  @workbook = nil
  @core, @app = Core.new, App.new
  @core.creator = options[:author] || @core.creator
  @core.created = options[:created_at]
  parse_options options
  yield self if block_given?
end