diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-05 17:54:06 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-06 09:56:26 +0200 |
| commit | c9133ad108ca80c5d99195a70a9bdd95e50dde1a (patch) | |
| tree | 642987284dd9d5b096641c5a9a35b8cb8bad3c89 | |
| parent | 412763fbf817da4519c544dd225803a80ca121f3 (diff) | |
| download | caxlsx-c9133ad108ca80c5d99195a70a9bdd95e50dde1a.tar.gz caxlsx-c9133ad108ca80c5d99195a70a9bdd95e50dde1a.zip | |
Fix Layout/EmptyLinesAroundAttributeAccessor
```
rubocop --only Layout/EmptyLinesAroundAttributeAccessor -a
```
| -rw-r--r-- | lib/axlsx/util/accessors.rb | 1 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 15 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/rich_text_run.rb | 15 |
3 files changed, 31 insertions, 0 deletions
diff --git a/lib/axlsx/util/accessors.rb b/lib/axlsx/util/accessors.rb index 3eab1d39..d49255be 100644 --- a/lib/axlsx/util/accessors.rb +++ b/lib/axlsx/util/accessors.rb @@ -54,6 +54,7 @@ module Axlsx def validated_attr_accessor(symbols, validator) symbols.each do |symbol| attr_reader symbol + module_eval(SETTER % [symbol, validator, symbol], __FILE__, __LINE__) end end diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 59b0b300..f52006bd 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -177,6 +177,7 @@ module Axlsx # The inline font_name property for the cell # @return [String] attr_reader :font_name + # @see font_name def font_name=(v) set_run_style :validate_string, :font_name, v; end @@ -203,6 +204,7 @@ module Axlsx # 255  OEM_CHARSET # @return [String] attr_reader :charset + # @see charset def charset=(v) set_run_style :validate_unsigned_int, :charset, v; end @@ -214,6 +216,7 @@ module Axlsx # 4 Script # 5 Decorative attr_reader :family + # @see family def family=(v) set_run_style :validate_family, :family, v.to_i @@ -222,42 +225,49 @@ module Axlsx # The inline bold property for the cell # @return [Boolean] attr_reader :b + # @see b def b=(v) set_run_style :validate_boolean, :b, v; end # The inline italic property for the cell # @return [Boolean] attr_reader :i + # @see i def i=(v) set_run_style :validate_boolean, :i, v; end # The inline strike property for the cell # @return [Boolean] attr_reader :strike + # @see strike def strike=(v) set_run_style :validate_boolean, :strike, v; end # The inline outline property for the cell # @return [Boolean] attr_reader :outline + # @see outline def outline=(v) set_run_style :validate_boolean, :outline, v; end # The inline shadow property for the cell # @return [Boolean] attr_reader :shadow + # @see shadow def shadow=(v) set_run_style :validate_boolean, :shadow, v; end # The inline condense property for the cell # @return [Boolean] attr_reader :condense + # @see condense def condense=(v) set_run_style :validate_boolean, :condense, v; end # The inline extend property for the cell # @return [Boolean] attr_reader :extend + # @see extend def extend=(v) set_run_style :validate_boolean, :extend, v; end @@ -267,6 +277,7 @@ module Axlsx # @return [String] # @note true is for backwards compatability and is reassigned to :single attr_reader :u + # @see u def u=(v) v = :single if (v == true || v == 1 || v == :true || v == 'true') @@ -276,6 +287,7 @@ module Axlsx # The inline color property for the cell # @return [Color] attr_reader :color + # @param [String] v The 8 character representation for an rgb color #FFFFFFFF" def color=(v) @color = v.is_a?(Color) ? v : Color.new(:rgb=>v) @@ -285,6 +297,7 @@ module Axlsx # The inline sz property for the cell # @return [Inteter] attr_reader :sz + # @see sz def sz=(v) set_run_style :validate_unsigned_int, :sz, v; end @@ -292,6 +305,7 @@ module Axlsx # this must be one of [:baseline, :subscript, :superscript] # @return [Symbol] attr_reader :vertAlign + # @see vertAlign def vertAlign=(v) RestrictionValidator.validate :cell_vertAlign, [:baseline, :subscript, :superscript], v @@ -302,6 +316,7 @@ module Axlsx # this must be one of [:none, major, minor] # @return [Symbol] attr_reader :scheme + # @see scheme def scheme=(v) RestrictionValidator.validate :cell_scheme, [:none, :major, :minor], v diff --git a/lib/axlsx/workbook/worksheet/rich_text_run.rb b/lib/axlsx/workbook/worksheet/rich_text_run.rb index b3870672..89dcd157 100644 --- a/lib/axlsx/workbook/worksheet/rich_text_run.rb +++ b/lib/axlsx/workbook/worksheet/rich_text_run.rb @@ -27,6 +27,7 @@ module Axlsx # The inline font_name property for the cell # @return [String] attr_reader :font_name + # @see font_name def font_name=(v) set_run_style :validate_string, :font_name, v; end @@ -53,6 +54,7 @@ module Axlsx # 255  OEM_CHARSET # @return [String] attr_reader :charset + # @see charset def charset=(v) set_run_style :validate_unsigned_int, :charset, v; end @@ -64,6 +66,7 @@ module Axlsx # 4 Script # 5 Decorative attr_reader :family + # @see family def family=(v) set_run_style :validate_family, :family, v.to_i @@ -72,42 +75,49 @@ module Axlsx # The inline bold property for the cell # @return [Boolean] attr_reader :b + # @see b def b=(v) set_run_style :validate_boolean, :b, v; end # The inline italic property for the cell # @return [Boolean] attr_reader :i + # @see i def i=(v) set_run_style :validate_boolean, :i, v; end # The inline strike property for the cell # @return [Boolean] attr_reader :strike + # @see strike def strike=(v) set_run_style :validate_boolean, :strike, v; end # The inline outline property for the cell # @return [Boolean] attr_reader :outline + # @see outline def outline=(v) set_run_style :validate_boolean, :outline, v; end # The inline shadow property for the cell # @return [Boolean] attr_reader :shadow + # @see shadow def shadow=(v) set_run_style :validate_boolean, :shadow, v; end # The inline condense property for the cell # @return [Boolean] attr_reader :condense + # @see condense def condense=(v) set_run_style :validate_boolean, :condense, v; end # The inline extend property for the cell # @return [Boolean] attr_reader :extend + # @see extend def extend=(v) set_run_style :validate_boolean, :extend, v; end @@ -117,6 +127,7 @@ module Axlsx # @return [String] # @note true is for backwards compatability and is reassigned to :single attr_reader :u + # @see u def u=(v) v = :single if (v == true || v == 1 || v == :true || v == 'true') @@ -126,6 +137,7 @@ module Axlsx # The inline color property for the cell # @return [Color] attr_reader :color + # @param [String] v The 8 character representation for an rgb color #FFFFFFFF" def color=(v) @color = v.is_a?(Color) ? v : Color.new(:rgb=>v) @@ -134,6 +146,7 @@ module Axlsx # The inline sz property for the cell # @return [Inteter] attr_reader :sz + # @see sz def sz=(v) set_run_style :validate_unsigned_int, :sz, v; end @@ -141,6 +154,7 @@ module Axlsx # this must be one of [:baseline, :subscript, :superscript] # @return [Symbol] attr_reader :vertAlign + # @see vertAlign def vertAlign=(v) RestrictionValidator.validate :cell_vertAlign, [:baseline, :subscript, :superscript], v @@ -151,6 +165,7 @@ module Axlsx # this must be one of [:none, major, minor] # @return [Symbol] attr_reader :scheme + # @see scheme def scheme=(v) RestrictionValidator.validate :cell_scheme, [:none, :major, :minor], v |
