summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-05 17:37:28 +0200
committerGeremia Taglialatela <[email protected]>2023-04-06 09:55:31 +0200
commita802d1d179f5ab56b419e1b47e62885d72b5384d (patch)
tree70e8cc79f12a4e17efb6dc0126cc0ed204669142 /lib
parentb5d7a7a1917adb12e3ea04abe261a37f8aff7f56 (diff)
downloadcaxlsx-a802d1d179f5ab56b419e1b47e62885d72b5384d.tar.gz
caxlsx-a802d1d179f5ab56b419e1b47e62885d72b5384d.zip
Fix Layout/EmptyLineBetweenDefs offenses
``` rubocop --only Layout/EmptyLineBetweenDefs -a ```
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/drawing/one_cell_anchor.rb1
-rw-r--r--lib/axlsx/package.rb1
-rw-r--r--lib/axlsx/stylesheet/color.rb2
-rw-r--r--lib/axlsx/stylesheet/font.rb2
-rw-r--r--lib/axlsx/util/validators.rb4
-rw-r--r--lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb1
-rw-r--r--lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb1
7 files changed, 12 insertions, 0 deletions
diff --git a/lib/axlsx/drawing/one_cell_anchor.rb b/lib/axlsx/drawing/one_cell_anchor.rb
index fc3dc48c..01767574 100644
--- a/lib/axlsx/drawing/one_cell_anchor.rb
+++ b/lib/axlsx/drawing/one_cell_anchor.rb
@@ -56,6 +56,7 @@ module Axlsx
def start_at(x, y=0)
from.coord x, y
end
+
#
# @see height
def height=(v) Axlsx::validate_unsigned_int(v); @height = v; end
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb
index e866444b..29f72d5c 100644
--- a/lib/axlsx/package.rb
+++ b/lib/axlsx/package.rb
@@ -47,6 +47,7 @@ module Axlsx
Axlsx::validate_boolean(v);
workbook.use_shared_strings = v
end
+
# The workbook this package will serialize or validate.
# @return [Workbook] If no workbook instance has been assigned with this package a new Workbook instance is returned.
# @raise ArgumentError if workbook parameter is not a Workbook instance.
diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb
index 32f18063..d7168ee7 100644
--- a/lib/axlsx/stylesheet/color.rb
+++ b/lib/axlsx/stylesheet/color.rb
@@ -47,6 +47,7 @@ module Axlsx
# @see auto
def auto=(v) Axlsx::validate_boolean v; @auto = v end
+
# @see color
def rgb=(v)
Axlsx::validate_string(v)
@@ -56,6 +57,7 @@ module Axlsx
raise ArgumentError, "Invalid color rgb value: #{v}." unless v.match(/[0-9A-F]{8}/)
@rgb = v
end
+
# @see tint
def tint=(v) Axlsx::validate_float v; @tint = v end
diff --git a/lib/axlsx/stylesheet/font.rb b/lib/axlsx/stylesheet/font.rb
index 8a52c810..4011f888 100644
--- a/lib/axlsx/stylesheet/font.rb
+++ b/lib/axlsx/stylesheet/font.rb
@@ -119,6 +119,7 @@ module Axlsx
def b=(v) Axlsx::validate_boolean v; @b = v end
# @see i
def i=(v) Axlsx::validate_boolean v; @i = v end
+
# @see u
def u=(v)
v = :single if (v == true || v == 1 || v == :true || v == 'true')
@@ -126,6 +127,7 @@ module Axlsx
Axlsx::validate_cell_u v
@u = v
end
+
# @see strike
def strike=(v) Axlsx::validate_boolean v; @strike = v end
# @see outline
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb
index 9e3d0de1..ebf8a280 100644
--- a/lib/axlsx/util/validators.rb
+++ b/lib/axlsx/util/validators.rb
@@ -31,6 +31,7 @@ module Axlsx
raise ArgumentError, (ERR_RANGE % [value.inspect, min.to_s, max.to_s, inclusive]) unless passes
end
end
+
# Validates the value against the regular expression provided.
class RegexValidator
# @param [String] name The name of what is being validated. This is included in the output when the value is invalid
@@ -142,6 +143,7 @@ module Axlsx
def self.validate_page_orientation(v)
RestrictionValidator.validate "page_orientation", [:default, :landscape, :portrait], v
end
+
# Requires that the value is one of :none, :single, :double, :singleAccounting, :doubleAccounting
def self.validate_cell_u(v)
RestrictionValidator.validate "cell run style u", [:none, :single, :double, :singleAccounting, :doubleAccounting], v
@@ -151,6 +153,7 @@ module Axlsx
def self.validate_family(v)
RestrictionValidator.validate "cell run style family", 1..5, v
end
+
# Requires that the value is valid pattern type.
# valid pattern types must be one of :none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal, :darkVertical, :darkDown,
# :darkUp, :darkGrid, :darkTrellis, :lightHorizontal, :lightVertical, :lightDown, :lightUp, :lightGrid, :lightTrellis, :gray125, or :gray0625.
@@ -213,6 +216,7 @@ module Axlsx
def self.validate_scatter_style(v)
Axlsx::RestrictionValidator.validate "ScatterChart.scatterStyle", [:none, :line, :lineMarker, :marker, :smooth, :smoothMarker], v.to_sym
end
+
# Requires that the value is a valid horizontal_alignment
# :general, :left, :center, :right, :fill, :justify, :centerContinuous, :distributed are allowed
# @param [Any] v The value validated
diff --git a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb
index 4635ba20..e419c0ab 100644
--- a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb
+++ b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb
@@ -63,6 +63,7 @@ module Axlsx
end
end
end
+
# serialize the object
# @return [String]
def to_xml_string(str='')
diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb
index 61957df0..4816fd55 100644
--- a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb
+++ b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb
@@ -67,6 +67,7 @@ module Axlsx
def apply(row, offset)
row.hidden = @filter.apply(row.cells[offset+col_id.to_i])
end
+
# @param [Boolean] hidden Flag indicating whether the AutoFilter button for this column is hidden.
# @return [Boolean]
def hidden_button=(hidden)