Method: Axlsx::NumDataSource#initialize

Defined in:
lib/axlsx/drawing/num_data_source.rb

#initialize(options = {}) ⇒ NumDataSource

creates a new NumDataSource object

Parameters:

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

    a customizable set of options

Options Hash (options):

  • data (Array)

    An array of Cells or Numeric objects

  • tag_name (Symbol)

    see tag_name



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/axlsx/drawing/num_data_source.rb', line 11

def initialize(options={})
  # override these three in child classes
  @data_type ||= NumData
  @tag_name ||= :val
  @ref_tag_name ||= :numRef

  @f = nil
  @data = @data_type.new(options)
  if options[:data] && options[:data].first.is_a?(Cell)
    @f = Axlsx::cell_range(options[:data])
  end
  parse_options options
end