aboutsummaryrefslogtreecommitdiffstats
path: root/lib/roo/excelx/workbook.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
commitdddfa903d2b856146f05ffb4415c31d6127bb5bf (patch)
treee38c2aca92b54f06ccd0185f48dc47e3e1b3d77e /lib/roo/excelx/workbook.rb
parent8280a21a23d44aa90177e2bc041d0b8dc8556f4b (diff)
New upstream version 2.8.0upstream/2.8.0
Diffstat (limited to 'lib/roo/excelx/workbook.rb')
-rw-r--r--lib/roo/excelx/workbook.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/roo/excelx/workbook.rb b/lib/roo/excelx/workbook.rb
index 7ef841f..c21bb1f 100644
--- a/lib/roo/excelx/workbook.rb
+++ b/lib/roo/excelx/workbook.rb
@@ -29,13 +29,17 @@ module Roo
# aka labels
def defined_names
- Hash[doc.xpath('//definedName').map do |defined_name|
+ doc.xpath('//definedName').each_with_object({}) do |defined_name, hash|
# "Sheet1!$C$5"
sheet, coordinates = defined_name.text.split('!$', 2)
col, row = coordinates.split('$')
name = defined_name['name']
- [name, Label.new(name, sheet, row, col)]
- end]
+ hash[name] = Label.new(name, sheet, row, col)
+ end
+ end
+
+ def base_timestamp
+ @base_timestamp ||= base_date.to_datetime.to_time.to_i
end
def base_date