Class: MergeExcel::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_excel/header.rb

Instance Method Summary collapse

Constructor Details

#initialize(array, extra_data_hash) ⇒ Header



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/merge_excel/header.rb', line 3

def initialize(array, extra_data_hash)

  if extra_data_hash
    extra_array = extra_data_hash.data.map{|e| e.label}
    case extra_data_hash.position
    when :beginning
      @array = extra_array + array
    else
      @array = array + extra_array
    end
  else
    @array = array
  end
end

Instance Method Details

#to_aObject



18
19
20
# File 'lib/merge_excel/header.rb', line 18

def to_a
  @array.to_a
end