Method: RubyExcel::Sheet#load

Defined in:
lib/rubyexcel/sheet.rb

#load(input_data, header_rows = 1) ⇒ Object

Populate the Sheet with data (overwrite)

Parameters:

  • input_data (Array<Array>, Hash<Hash>)

    the data to fill the Sheet with

  • header_rows (Fixnum) (defaults to: 1)

    the number of Rows to be treated as headers



378
379
380
381
382
383
# File 'lib/rubyexcel/sheet.rb', line 378

def load( input_data, header_rows=1 )
  input_data = _convert_hash(input_data) if input_data.is_a?(Hash)
  input_data.is_a?(Array) or fail ArgumentError, 'Input must be an Array or Hash'
  @header_rows = header_rows
  @data = Data.new( self, input_data ); self
end