lib/xlsx/cell.rb in simonmenke-xlsx-0.0.1 vs lib/xlsx/cell.rb in simonmenke-xlsx-0.0.2

- old
+ new

@@ -1,9 +1,15 @@ module XLSX class Cell # :nodoc: + STYLES = {'Default' => '1', + 'Result' => '2', + 'Result2' => '3', + 'Heading' => '4', + 'Heading1' => '5'} + 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 @@ -12,10 +18,10 @@ def self.storage_hash(row, column) Digest::SHA1.hexdigest("#{row}-#{column}") end - attr_accessor :sheet, :type, :value, :row, :column + attr_accessor :sheet, :type, :value, :style, :row, :column def initialize(sheet, row, column) @sheet, @row, @column = sheet, row.to_i, column.to_i end