Class: Verokrypto::Xlsx
- Inherits:
-
Object
- Object
- Verokrypto::Xlsx
- Defined in:
- lib/verokrypto/xlsx.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Xlsx
constructor
A new instance of Xlsx.
- #parse ⇒ Object
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
#parse ⇒ Object
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 |