diff options
| author | pjskennedy <[email protected]> | 2022-03-02 10:02:10 -0800 |
|---|---|---|
| committer | pjskennedy <[email protected]> | 2022-03-02 10:02:10 -0800 |
| commit | 20e3f21964c60477e68d4d3731a11a1650ea5061 (patch) | |
| tree | adf20e15c84507815cdfeab2f0c49c2268fe3805 /lib/axlsx/stylesheet | |
| parent | f30f5e5844e9fd4e3e099fbe3bedf927a8f24966 (diff) | |
| download | caxlsx-20e3f21964c60477e68d4d3731a11a1650ea5061.tar.gz caxlsx-20e3f21964c60477e68d4d3731a11a1650ea5061.zip | |
Update references to use new class method
Diffstat (limited to 'lib/axlsx/stylesheet')
| -rw-r--r-- | lib/axlsx/stylesheet/font.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/stylesheet/styles.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/axlsx/stylesheet/font.rb b/lib/axlsx/stylesheet/font.rb index d9a4a4d8..093d160e 100644 --- a/lib/axlsx/stylesheet/font.rb +++ b/lib/axlsx/stylesheet/font.rb @@ -147,7 +147,7 @@ module Axlsx # @return [String] def to_xml_string(str = '') str << '<font>' - instance_values.each do |k, v| + Axlsx.instance_values(self).each do |k, v| v.is_a?(Color) ? v.to_xml_string(str) : (str << ('<' << k.to_s << ' val="' << Axlsx.booleanize(v).to_s << '"/>')) end str << '</font>' diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index d1ee1f66..c9fdbf55 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -279,7 +279,7 @@ module Axlsx # @return [Font|Integer] def parse_font_options(options={}) return if (options.keys & [:fg_color, :sz, :b, :i, :u, :strike, :outline, :shadow, :charset, :family, :font_name]).empty? - fonts.first.instance_values.each do |key, value| + Axlsx.instance_values(fonts.first).each do |key, value| # Thanks for that 1.8.7 - cant do a simple merge... options[key.to_sym] = value unless options.keys.include?(key.to_sym) end @@ -438,8 +438,9 @@ module Axlsx # @return [String] def to_xml_string(str = '') str << ('<styleSheet xmlns="' << XML_NS << '">') + instance_vals = Axlsx.instance_values(self) [:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :cellStyles, :dxfs, :tableStyles].each do |key| - self.instance_values[key.to_s].to_xml_string(str) unless self.instance_values[key.to_s].nil? + instance_vals[key.to_s].to_xml_string(str) unless instance_vals[key.to_s].nil? end str << '</styleSheet>' end |
