diff options
| author | Randy Morgan <[email protected]> | 2011-12-16 02:31:12 -0800 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-12-16 02:31:12 -0800 |
| commit | 663ca52a9e06017b75f094854a00ec4684e4078a (patch) | |
| tree | 5a88fd16fe73912ce0471227aeb143e1e3cd1632 /lib | |
| parent | 0143835085fae316d9b0177d0353149cb3f84386 (diff) | |
| parent | 1fb348ea888b9b5bec92606ebaedd61154001e2e (diff) | |
| download | caxlsx-663ca52a9e06017b75f094854a00ec4684e4078a.tar.gz caxlsx-663ca52a9e06017b75f094854a00ec4684e4078a.zip | |
Merge pull request #8 from ochko/master
Little performance improvement
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 7e043438..0f06bd13 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -175,14 +175,14 @@ module Axlsx # @option options [String] color an 8 letter rgb specification # @option options [Symbol] scheme must be one of :none, major, :minor def initialize(row, value="", options={}) - self.row=row + self.row=row @styles = row.worksheet.workbook.styles - @style = 0 - @type = cell_type_from_value(value) @row.cells << self options.each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end + @style ||= 0 + @type ||= cell_type_from_value(value) @value = cast_value(value) end |
