diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-03 18:45:30 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-03 18:45:30 +0200 |
| commit | 6a61caa26ef8e8fbe3a88ecd9341976e5a177db5 (patch) | |
| tree | 076ea47e1644fe37909d2438d9dc3c97ca50ef5c /lib/axlsx/drawing | |
| parent | aaf88bd98054b1823ba0ade4b883b84e41b5e947 (diff) | |
| download | caxlsx-6a61caa26ef8e8fbe3a88ecd9341976e5a177db5.tar.gz caxlsx-6a61caa26ef8e8fbe3a88ecd9341976e5a177db5.zip | |
Fix safe, minor offenses to production code
- Lint/RedundantStringCoercion
- Style/CommentAnnotation offenses
- Style/DefWithParentheses
- Style/EvalWithLocation
- Style/MethodCallWithoutArgsParentheses
- Style/MethodDefParentheses
- Style/NilComparison
- Style/Semicolon
Diffstat (limited to 'lib/axlsx/drawing')
| -rw-r--r-- | lib/axlsx/drawing/axis.rb | 6 | ||||
| -rw-r--r-- | lib/axlsx/drawing/chart.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/drawing/view_3D.rb | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb index 9ca03fb1..601a7c85 100644 --- a/lib/axlsx/drawing/axis.rb +++ b/lib/axlsx/drawing/axis.rb @@ -152,7 +152,7 @@ module Axlsx str << ('<c:delete val="' << @delete.to_s << '"/>') str << ('<c:axPos val="' << @ax_pos.to_s << '"/>') str << '<c:majorGridlines>' - # TODO shape properties need to be extracted into a class + # TODO: shape properties need to be extracted into a class if gridlines == false str << '<c:spPr>' str << '<a:ln>' @@ -161,7 +161,7 @@ module Axlsx str << '</c:spPr>' end str << '</c:majorGridlines>' - @title.to_xml_string(str) unless @title == nil + @title.to_xml_string(str) unless @title.nil? # Need to set sourceLinked to 0 if we're setting a format code on this row # otherwise it will never take, as it will always prefer the 'General' formatting # of the cells themselves @@ -169,7 +169,7 @@ module Axlsx str << '<c:majorTickMark val="none"/>' str << '<c:minorTickMark val="none"/>' str << ('<c:tickLblPos val="' << @tick_lbl_pos.to_s << '"/>') - # TODO - this is also being used for series colors + # TODO: this is also being used for series colors # time to extract this into a class spPr - Shape Properties if @color str << '<c:spPr><a:ln><a:solidFill>' diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb index e9f4441f..0c68ff4b 100644 --- a/lib/axlsx/drawing/chart.rb +++ b/lib/axlsx/drawing/chart.rb @@ -49,7 +49,7 @@ module Axlsx # @return [Series] attr_reader :series_type - # TODO data labels! + # TODO: data labels! def d_lbls @d_lbls ||= DLbls.new(self.class) end @@ -210,7 +210,7 @@ module Axlsx str << ('<c:style val="' << style.to_s << '"/>') str << '<c:chart>' @title.to_xml_string(str) unless @title.empty? - str << ('<c:autoTitleDeleted val="' << (@title == nil).to_s << '"/>') + str << ('<c:autoTitleDeleted val="' << @title.nil?.to_s << '"/>') @view_3D.to_xml_string(str) if @view_3D str << '<c:floor><c:thickness val="0"/></c:floor>' str << '<c:sideWall><c:thickness val="0"/></c:sideWall>' diff --git a/lib/axlsx/drawing/view_3D.rb b/lib/axlsx/drawing/view_3D.rb index 1f701f32..ff26deb9 100644 --- a/lib/axlsx/drawing/view_3D.rb +++ b/lib/axlsx/drawing/view_3D.rb @@ -104,10 +104,10 @@ module Axlsx private - # Note: move this to Axlsx module if we find the smae pattern elsewhere. + # NOTE: move this to Axlsx module if we find the same pattern elsewhere. def element_for_attribute(name, namespace = '') val = Axlsx.instance_values_for(self)[name] - return "" if val == nil + return "" if val.nil? "<%s:%s val='%s'/>" % [namespace, Axlsx::camel(name, false), val] end |
