Sha256: daca6ba1ca2d0efe1fe6342d15cc8561f1dd6a930853c42d4bcc9e5eae69adfa

Contents?: true

Size: 391 Bytes

Versions: 6

Compression:

Stored size: 391 Bytes

Contents

# frozen_string_literal: true

module SimpleTextExtract
  module FormatExtractor
    class Xls < Base
      def extract
        require "spreadsheet"

        spreadsheet = Spreadsheet.open(file)
        text = []
        spreadsheet.worksheets.each do |sheet|
          text << sheet.name
          text << sheet.rows
        end

        text.flatten.join(" ")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
simple_text_extract-2.0.0 lib/simple_text_extract/format_extractor/xls.rb
simple_text_extract-1.3.0 lib/simple_text_extract/format_extractor/xls.rb
simple_text_extract-1.2.0 lib/simple_text_extract/format_extractor/xls.rb
simple_text_extract-1.1.0 lib/simple_text_extract/format_extractor/xls.rb
simple_text_extract-1.0.2 lib/simple_text_extract/format_extractor/xls.rb
simple_text_extract-1.0.1 lib/simple_text_extract/format_extractor/xls.rb