class MergeExcel::DataRow

Attributes

array[R]

Public Class Methods

new(array, extra_col_hash, book) click to toggle source
# File lib/merge_excel/data_row.rb, line 5
def initialize(array, extra_col_hash, book)
  if extra_col_hash
    extra_array = extra_col_hash.data.map do |e|
      case e.type
      when :filename
        book.filename
      when :cell_value
        book.cell_value_at(e.sheet_idx, e.row_idx, e.col_idx)
      else
        # error?
      end
    end
    case extra_col_hash.position
    when :beginning
      @array = extra_array + array
    else
      @array = array + extra_array
    end
  else
    @array = array
  end
end

Public Instance Methods

to_a() click to toggle source
# File lib/merge_excel/data_row.rb, line 28
def to_a
  @array.to_a
end