module XLSX class Cell # :nodoc: def self.type_of(value) return 's' if value.is_a? String return 'n' if value.is_a? Integer return 'n' if value.respond_to? :to_i return 's' if value.respond_to? :to_s return 's' # default end def self.storage_hash(row, column) Digest::SHA1.hexdigest("#{row}-#{column}") end attr_accessor :sheet, :type, :value, :row, :column def initialize(sheet, row, column) @sheet, @row, @column = sheet, row.to_i, column.to_i end def storage_hash @storage_hash ||= self.class.storage_hash(row, column) end def <=>(other) return(0) unless other.is_a?(::XLSX::Cell) order = (self.row <=> other.row) order = (self.column <=> other.column) if order == 0 order rescue 0 end end end