From 2ed0f25b31aa7ced3ff4e1f8307424be7624c667 Mon Sep 17 00:00:00 2001 From: Stefan Daschek Date: Fri, 23 Sep 2022 10:44:41 +0200 Subject: Improve documentation for `Worksheet#styles` Closes #166 --- lib/axlsx/workbook/worksheet/worksheet.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index f8882559..921687c8 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -627,11 +627,12 @@ module Axlsx r = rows[row_index] if r - return r[col_index] + return r[col_index] end end - # shortcut method to access styles direclty from the worksheet + # Shortcut method to access workbook styles + # # This lets us do stuff like: # @example # p = Axlsx::Package.new @@ -640,6 +641,9 @@ module Axlsx # sheet.add_row ['Oh No!'], :styles => my_style # end # p.serialize 'foo.xlsx' + # + # @note The XLSX format does not support worksheet-specific styles. Even when using this method + # you're still working with the single global {Axlsx::Styles} object in the workbook. def styles @styles ||= self.workbook.styles end -- cgit v1.2.3