diff options
| author | ochko <[email protected]> | 2012-01-19 11:11:55 +0900 |
|---|---|---|
| committer | ochko <[email protected]> | 2012-01-19 11:11:55 +0900 |
| commit | 2484975e3a56e935b5f24924a6eb048f9fd40ce1 (patch) | |
| tree | 2aabdf6ee8c5bf2204c4ffe050f3d621e7909258 | |
| parent | 4b41a76d088b2ed28f981950c805f5785884ad15 (diff) | |
| download | caxlsx-2484975e3a56e935b5f24924a6eb048f9fd40ce1.tar.gz caxlsx-2484975e3a56e935b5f24924a6eb048f9fd40ce1.zip | |
Set default date1904 attribute using platform string
| -rw-r--r-- | lib/axlsx/workbook/workbook.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb index edb02d81..c5fec5f9 100644 --- a/lib/axlsx/workbook/workbook.rb +++ b/lib/axlsx/workbook/workbook.rb @@ -89,10 +89,14 @@ require 'axlsx/workbook/worksheet/worksheet.rb' @drawings = SimpleTypedList.new Drawing @charts = SimpleTypedList.new Chart @images = SimpleTypedList.new Pic - self.date1904= options[:date1904] unless options[:date1904].nil? + self.date1904= options[:date1904].nil? ? is_darwin? : options[:date1904] yield self if block_given? end + def is_darwin? + RUBY_PLATFORM.downcase.include?('darwin') + end + # Instance level access to the class variable 1904 # @return [Boolean] def date1904() @@date1904; end |
