Class: Verokrypto::Xlsx

Inherits:
Object
  • Object
show all
Defined in:
lib/verokrypto/xlsx.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Xlsx

Returns a new instance of Xlsx.



7
8
9
# File 'lib/verokrypto/xlsx.rb', line 7

def initialize(path)
  @path = path
end

Instance Method Details

#parseObject



11
12
13
14
15
16
17
18
# File 'lib/verokrypto/xlsx.rb', line 11

def parse
  workbook = RubyXL::Parser.parse(@path)
  fields, *rows = workbook[0].map do |row|
    row.cells.map(&:value)
  end

  [fields, rows]
end