diff options
Diffstat (limited to 'lib/axlsx/workbook/worksheet')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 10 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell_serializer.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/color_scale.rb | 8 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/data_bar.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/rich_text_run.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/row_breaks.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/table_style_info.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/worksheet.rb | 2 |
9 files changed, 17 insertions, 17 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 7f24c9b7..b8b4fea5 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -375,11 +375,11 @@ module Axlsx # @param [Cell, String] target The last cell, or str ref for the cell in the merge range def merge(target) start, stop = if target.is_a?(String) - [self.r, target] + [r, target] elsif target.is_a?(Cell) Axlsx.sort_cells([self, target]).map(&:r) end - self.row.worksheet.merge_cells "#{start}:#{stop}" unless stop.nil? + row.worksheet.merge_cells "#{start}:#{stop}" unless stop.nil? end # Serializes the cell @@ -483,7 +483,7 @@ module Axlsx return unless INLINE_STYLES.include?(attr.to_sym) Axlsx.send(validator, value) unless validator.nil? - self.instance_variable_set :"@#{attr}", value + instance_variable_set :"@#{attr}", value @is_text_run = true end @@ -530,14 +530,14 @@ module Axlsx case type when :date - self.style = STYLE_DATE if self.style.zero? + self.style = STYLE_DATE if style.zero? if !v.is_a?(Date) && v.respond_to?(:to_date) v.to_date else v end when :time - self.style = STYLE_DATE if self.style.zero? + self.style = STYLE_DATE if style.zero? if !v.is_a?(Time) && v.respond_to?(:to_time) v.to_time else diff --git a/lib/axlsx/workbook/worksheet/cell_serializer.rb b/lib/axlsx/workbook/worksheet/cell_serializer.rb index 5567c4d6..2124a7f4 100644 --- a/lib/axlsx/workbook/worksheet/cell_serializer.rb +++ b/lib/axlsx/workbook/worksheet/cell_serializer.rb @@ -16,7 +16,7 @@ module Axlsx return str << '/>' if cell.value.nil? method = cell.type - self.send(method, cell, str) + send(method, cell, str) str << '</c>' end diff --git a/lib/axlsx/workbook/worksheet/color_scale.rb b/lib/axlsx/workbook/worksheet/color_scale.rb index e48de3bb..84ece25b 100644 --- a/lib/axlsx/workbook/worksheet/color_scale.rb +++ b/lib/axlsx/workbook/worksheet/color_scale.rb @@ -22,7 +22,7 @@ module Axlsx # color_scale = Axlsx::ColorScale.two_tone # @see examples/example.rb conditional formatting examples. def two_tone - self.new + new end # A builder for three tone color gradient @@ -31,9 +31,9 @@ module Axlsx # color_scale = Axlsx::ColorScale.three_tone # @see examples/example.rb conditional formatting examples. def three_tone - self.new({ type: :min, val: 0, color: 'FFF8696B' }, - { type: :percent, val: '50', color: 'FFFFEB84' }, - { type: :max, val: 0, color: 'FF63BE7B' }) + new({ type: :min, val: 0, color: 'FFF8696B' }, + { type: :percent, val: '50', color: 'FFFFEB84' }, + { type: :max, val: 0, color: 'FF63BE7B' }) end end # A simple typed list of cfvos diff --git a/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb b/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb index f848d1be..85ef886e 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb @@ -208,7 +208,7 @@ module Axlsx str << '<cfRule ' serialized_attributes str str << '>' - str << '<formula>' << [*self.formula].join('</formula><formula>') << '</formula>' if @formula + str << '<formula>' << [*formula].join('</formula><formula>') << '</formula>' if @formula @color_scale.to_xml_string(str) if @color_scale && @type == :colorScale @data_bar.to_xml_string(str) if @data_bar && @type == :dataBar @icon_set.to_xml_string(str) if @icon_set && @type == :iconSet diff --git a/lib/axlsx/workbook/worksheet/data_bar.rb b/lib/axlsx/workbook/worksheet/data_bar.rb index 74158d98..95e54742 100644 --- a/lib/axlsx/workbook/worksheet/data_bar.rb +++ b/lib/axlsx/workbook/worksheet/data_bar.rb @@ -100,7 +100,7 @@ module Axlsx # @param [Color|String] v The color object, or rgb string value to apply def color=(v) @color = v if v.is_a? Color - self.color.rgb = v if v.is_a? String + color.rgb = v if v.is_a? String end # Serialize this object to an xml string @@ -109,7 +109,7 @@ module Axlsx def to_xml_string(str = +'') serialized_tag('dataBar', str) do value_objects.to_xml_string(str) - self.color.to_xml_string(str) + color.to_xml_string(str) end end diff --git a/lib/axlsx/workbook/worksheet/rich_text_run.rb b/lib/axlsx/workbook/worksheet/rich_text_run.rb index 4934523d..b2cd8a51 100644 --- a/lib/axlsx/workbook/worksheet/rich_text_run.rb +++ b/lib/axlsx/workbook/worksheet/rich_text_run.rb @@ -199,7 +199,7 @@ module Axlsx return unless INLINE_STYLES.include?(attr.to_sym) Axlsx.send(validator, value) unless validator.nil? - self.instance_variable_set :"@#{attr}", value + instance_variable_set :"@#{attr}", value end # Serializes the RichTextRun diff --git a/lib/axlsx/workbook/worksheet/row_breaks.rb b/lib/axlsx/workbook/worksheet/row_breaks.rb index 381dc0b6..98409ab4 100644 --- a/lib/axlsx/workbook/worksheet/row_breaks.rb +++ b/lib/axlsx/workbook/worksheet/row_breaks.rb @@ -26,7 +26,7 @@ module Axlsx def to_xml_string(str = +'') return if empty? - str << '<rowBreaks count="' << self.size.to_s << '" manualBreakCount="' << self.size.to_s << '">' + str << '<rowBreaks count="' << size.to_s << '" manualBreakCount="' << size.to_s << '">' each { |brk| brk.to_xml_string(str) } str << '</rowBreaks>' end diff --git a/lib/axlsx/workbook/worksheet/table_style_info.rb b/lib/axlsx/workbook/worksheet/table_style_info.rb index 3793d488..218e313e 100644 --- a/lib/axlsx/workbook/worksheet/table_style_info.rb +++ b/lib/axlsx/workbook/worksheet/table_style_info.rb @@ -34,7 +34,7 @@ module Axlsx # explicitly be disabled or all will show. def initialize_defaults %w(show_first_column show_last_column show_row_stripes show_column_stripes).each do |attr| - self.send("#{attr}=", 0) + send("#{attr}=", 0) end end diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index 47373d75..081f50d8 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -711,7 +711,7 @@ module Axlsx # @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 + @styles ||= workbook.styles end # shortcut level to specify the outline level for a series of rows |
