Sha256: 097922004ba590680851100b9398f76ebd1f49e3ae3a286a0ee45e12df23ae42

Contents?: true

Size: 649 Bytes

Versions: 3

Compression:

Stored size: 649 Bytes

Contents

require 'rubyXL'
require 'berkeley_library/util/xlsx/rubyxl_cell_extensions'

module BerkeleyLibrary
  module Util
    module XLSX
      module RubyXLWorksheetExtensions
        def first_blank_column_index
          sheet_data.rows.inject(0) do |first_blank_c_index, row|
            trailing_blank_cells = row.cells.reverse.take_while(&:blank?)
            row_first_blank_c_index = row.size - trailing_blank_cells.size
            [first_blank_c_index, row_first_blank_c_index].max
          end
        end
      end
    end
  end
end

module RubyXL
  class Worksheet
    prepend BerkeleyLibrary::Util::XLSX::RubyXLWorksheetExtensions
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
berkeley_library-holdings-1.0.4 lib/berkeley_library/util/xlsx/rubyxl_worksheet_extensions.rb
berkeley_library-holdings-1.0.3 lib/berkeley_library/util/xlsx/rubyxl_worksheet_extensions.rb
berkeley_library-holdings-1.0.2 lib/berkeley_library/util/xlsx/rubyxl_worksheet_extensions.rb