caxlsx 4.0.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -12
  3. data/README.md +18 -9
  4. data/Rakefile +2 -9
  5. data/examples/generate.rb +3 -1
  6. data/lib/axlsx/content_type/abstract_content_type.rb +6 -3
  7. data/lib/axlsx/content_type/content_type.rb +4 -4
  8. data/lib/axlsx/content_type/default.rb +4 -1
  9. data/lib/axlsx/content_type/override.rb +4 -1
  10. data/lib/axlsx/doc_props/app.rb +91 -24
  11. data/lib/axlsx/drawing/area_chart.rb +3 -3
  12. data/lib/axlsx/drawing/area_series.rb +10 -4
  13. data/lib/axlsx/drawing/ax_data_source.rb +1 -1
  14. data/lib/axlsx/drawing/axes.rb +1 -1
  15. data/lib/axlsx/drawing/axis.rb +25 -7
  16. data/lib/axlsx/drawing/bar_3D_chart.rb +14 -4
  17. data/lib/axlsx/drawing/bar_chart.rb +14 -4
  18. data/lib/axlsx/drawing/bar_series.rb +14 -5
  19. data/lib/axlsx/drawing/bubble_chart.rb +2 -2
  20. data/lib/axlsx/drawing/bubble_series.rb +2 -2
  21. data/lib/axlsx/drawing/cat_axis.rb +23 -8
  22. data/lib/axlsx/drawing/chart.rb +33 -8
  23. data/lib/axlsx/drawing/d_lbls.rb +9 -8
  24. data/lib/axlsx/drawing/drawing.rb +50 -49
  25. data/lib/axlsx/drawing/hyperlink.rb +13 -4
  26. data/lib/axlsx/drawing/line_3D_chart.rb +3 -3
  27. data/lib/axlsx/drawing/line_chart.rb +3 -3
  28. data/lib/axlsx/drawing/line_series.rb +10 -4
  29. data/lib/axlsx/drawing/marker.rb +19 -4
  30. data/lib/axlsx/drawing/num_val.rb +1 -1
  31. data/lib/axlsx/drawing/one_cell_anchor.rb +8 -2
  32. data/lib/axlsx/drawing/pic.rb +17 -8
  33. data/lib/axlsx/drawing/pie_3D_chart.rb +3 -3
  34. data/lib/axlsx/drawing/pie_chart.rb +36 -0
  35. data/lib/axlsx/drawing/pie_series.rb +18 -6
  36. data/lib/axlsx/drawing/scaling.rb +18 -4
  37. data/lib/axlsx/drawing/scatter_chart.rb +2 -2
  38. data/lib/axlsx/drawing/scatter_series.rb +2 -2
  39. data/lib/axlsx/drawing/ser_axis.rb +11 -5
  40. data/lib/axlsx/drawing/series.rb +8 -2
  41. data/lib/axlsx/drawing/two_cell_anchor.rb +1 -1
  42. data/lib/axlsx/drawing/val_axis.rb +2 -2
  43. data/lib/axlsx/drawing/view_3D.rb +8 -2
  44. data/lib/axlsx/drawing/vml_shape.rb +1 -1
  45. data/lib/axlsx/package.rb +54 -21
  46. data/lib/axlsx/rels/relationship.rb +15 -5
  47. data/lib/axlsx/rels/relationships.rb +3 -3
  48. data/lib/axlsx/stylesheet/border.rb +12 -3
  49. data/lib/axlsx/stylesheet/border_pr.rb +16 -4
  50. data/lib/axlsx/stylesheet/cell_alignment.rb +39 -10
  51. data/lib/axlsx/stylesheet/cell_protection.rb +9 -2
  52. data/lib/axlsx/stylesheet/cell_style.rb +30 -7
  53. data/lib/axlsx/stylesheet/color.rb +10 -4
  54. data/lib/axlsx/stylesheet/dxf.rb +29 -6
  55. data/lib/axlsx/stylesheet/fill.rb +4 -1
  56. data/lib/axlsx/stylesheet/font.rb +59 -13
  57. data/lib/axlsx/stylesheet/gradient_fill.rb +9 -3
  58. data/lib/axlsx/stylesheet/gradient_stop.rb +9 -2
  59. data/lib/axlsx/stylesheet/num_fmt.rb +8 -2
  60. data/lib/axlsx/stylesheet/pattern_fill.rb +15 -3
  61. data/lib/axlsx/stylesheet/styles.rb +84 -43
  62. data/lib/axlsx/stylesheet/table_style.rb +15 -4
  63. data/lib/axlsx/stylesheet/table_style_element.rb +12 -3
  64. data/lib/axlsx/stylesheet/table_styles.rb +10 -3
  65. data/lib/axlsx/stylesheet/theme.rb +163 -0
  66. data/lib/axlsx/stylesheet/xf.rb +70 -16
  67. data/lib/axlsx/util/accessors.rb +9 -7
  68. data/lib/axlsx/util/buffered_zip_output_stream.rb +6 -2
  69. data/lib/axlsx/util/constants.rb +14 -2
  70. data/lib/axlsx/util/mime_type_utils.rb +72 -13
  71. data/lib/axlsx/util/serialized_attributes.rb +2 -2
  72. data/lib/axlsx/util/simple_typed_list.rb +26 -14
  73. data/lib/axlsx/util/storage.rb +4 -4
  74. data/lib/axlsx/util/uri_utils.rb +70 -0
  75. data/lib/axlsx/util/validators.rb +6 -6
  76. data/lib/axlsx/version.rb +1 -1
  77. data/lib/axlsx/workbook/defined_name.rb +2 -1
  78. data/lib/axlsx/workbook/defined_names.rb +1 -1
  79. data/lib/axlsx/workbook/shared_strings_table.rb +3 -3
  80. data/lib/axlsx/workbook/workbook.rb +87 -67
  81. data/lib/axlsx/workbook/workbook_view.rb +1 -1
  82. data/lib/axlsx/workbook/workbook_views.rb +1 -1
  83. data/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb +4 -4
  84. data/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +5 -3
  85. data/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +4 -4
  86. data/lib/axlsx/workbook/worksheet/auto_filter/sort_condition.rb +1 -1
  87. data/lib/axlsx/workbook/worksheet/auto_filter/sort_state.rb +2 -2
  88. data/lib/axlsx/workbook/worksheet/border_creator.rb +4 -4
  89. data/lib/axlsx/workbook/worksheet/cell.rb +40 -20
  90. data/lib/axlsx/workbook/worksheet/cell_serializer.rb +1 -1
  91. data/lib/axlsx/workbook/worksheet/cfvo.rb +8 -2
  92. data/lib/axlsx/workbook/worksheet/col.rb +23 -9
  93. data/lib/axlsx/workbook/worksheet/col_breaks.rb +1 -1
  94. data/lib/axlsx/workbook/worksheet/cols.rb +1 -1
  95. data/lib/axlsx/workbook/worksheet/comment.rb +2 -2
  96. data/lib/axlsx/workbook/worksheet/comments.rb +1 -1
  97. data/lib/axlsx/workbook/worksheet/conditional_formatting.rb +9 -3
  98. data/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +70 -15
  99. data/lib/axlsx/workbook/worksheet/conditional_formattings.rb +3 -3
  100. data/lib/axlsx/workbook/worksheet/data_validation.rb +53 -14
  101. data/lib/axlsx/workbook/worksheet/data_validations.rb +3 -3
  102. data/lib/axlsx/workbook/worksheet/date_time_converter.rb +2 -2
  103. data/lib/axlsx/workbook/worksheet/dimension.rb +1 -1
  104. data/lib/axlsx/workbook/worksheet/header_footer.rb +1 -1
  105. data/lib/axlsx/workbook/worksheet/icon_set.rb +17 -5
  106. data/lib/axlsx/workbook/worksheet/merged_cells.rb +1 -1
  107. data/lib/axlsx/workbook/worksheet/outline_pr.rb +1 -1
  108. data/lib/axlsx/workbook/worksheet/page_margins.rb +30 -7
  109. data/lib/axlsx/workbook/worksheet/page_set_up_pr.rb +1 -2
  110. data/lib/axlsx/workbook/worksheet/page_setup.rb +32 -9
  111. data/lib/axlsx/workbook/worksheet/pane.rb +9 -2
  112. data/lib/axlsx/workbook/worksheet/pivot_table.rb +30 -6
  113. data/lib/axlsx/workbook/worksheet/pivot_tables.rb +1 -1
  114. data/lib/axlsx/workbook/worksheet/print_options.rb +1 -0
  115. data/lib/axlsx/workbook/worksheet/protected_ranges.rb +1 -1
  116. data/lib/axlsx/workbook/worksheet/rich_text_run.rb +31 -11
  117. data/lib/axlsx/workbook/worksheet/row.rb +5 -2
  118. data/lib/axlsx/workbook/worksheet/row_breaks.rb +1 -1
  119. data/lib/axlsx/workbook/worksheet/selection.rb +8 -2
  120. data/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb +1 -0
  121. data/lib/axlsx/workbook/worksheet/sheet_pr.rb +1 -1
  122. data/lib/axlsx/workbook/worksheet/sheet_protection.rb +1 -1
  123. data/lib/axlsx/workbook/worksheet/sheet_view.rb +30 -9
  124. data/lib/axlsx/workbook/worksheet/table_style_info.rb +3 -2
  125. data/lib/axlsx/workbook/worksheet/tables.rb +1 -1
  126. data/lib/axlsx/workbook/worksheet/worksheet.rb +28 -14
  127. data/lib/axlsx/workbook/worksheet/worksheet_comments.rb +4 -4
  128. data/lib/axlsx/workbook/worksheet/worksheet_drawing.rb +1 -1
  129. data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +3 -2
  130. data/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +2 -2
  131. data/lib/axlsx.rb +46 -30
  132. data/lib/caxlsx.rb +1 -1
  133. metadata +13 -52
@@ -43,15 +43,24 @@ module Axlsx
43
43
  attr_reader :prs
44
44
 
45
45
  # @see diagonalUp
46
- def diagonal_up=(v) Axlsx.validate_boolean v; @diagonal_up = v end
46
+ def diagonal_up=(v)
47
+ Axlsx.validate_boolean v
48
+ @diagonal_up = v
49
+ end
47
50
  alias :diagonalUp= :diagonal_up=
48
51
 
49
52
  # @see diagonalDown
50
- def diagonal_down=(v) Axlsx.validate_boolean v; @diagonal_down = v end
53
+ def diagonal_down=(v)
54
+ Axlsx.validate_boolean v
55
+ @diagonal_down = v
56
+ end
51
57
  alias :diagonalDown= :diagonal_down=
52
58
 
53
59
  # @see outline
54
- def outline=(v) Axlsx.validate_boolean v; @outline = v end
60
+ def outline=(v)
61
+ Axlsx.validate_boolean v
62
+ @outline = v
63
+ end
55
64
 
56
65
  # Serializes the object
57
66
  # @param [String] str
@@ -4,10 +4,11 @@ module Axlsx
4
4
  # A border part.
5
5
  class BorderPr
6
6
  include Axlsx::OptionsParser
7
+
7
8
  # @return [Color] The color of this border part.
8
9
  attr_reader :color
9
10
 
10
- # @return [Symbol] The syle of this border part.
11
+ # @return [Symbol] The style of this border part.
11
12
  # @note
12
13
  # The following are allowed
13
14
  # :none
@@ -53,11 +54,22 @@ module Axlsx
53
54
  end
54
55
 
55
56
  # @see name
56
- def name=(v) RestrictionValidator.validate "BorderPr.name", [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal], v; @name = v end
57
+ def name=(v)
58
+ RestrictionValidator.validate "BorderPr.name", [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal], v
59
+ @name = v
60
+ end
61
+
57
62
  # @see color
58
- def color=(v) DataTypeValidator.validate(:color, Color, v); @color = v end
63
+ def color=(v)
64
+ DataTypeValidator.validate(:color, Color, v)
65
+ @color = v
66
+ end
67
+
59
68
  # @see style
60
- def style=(v) RestrictionValidator.validate "BorderPr.style", [:none, :thin, :medium, :dashed, :dotted, :thick, :double, :hair, :mediumDashed, :dashDot, :mediumDashDot, :dashDotDot, :mediumDashDotDot, :slantDashDot], v; @style = v end
69
+ def style=(v)
70
+ RestrictionValidator.validate "BorderPr.style", [:none, :thin, :medium, :dashed, :dotted, :thick, :double, :hair, :mediumDashed, :dashDot, :mediumDashDot, :dashDotDot, :mediumDashDotDot, :slantDashDot], v
71
+ @style = v
72
+ end
61
73
 
62
74
  # Serializes the object
63
75
  # @param [String] str
@@ -25,7 +25,7 @@ module Axlsx
25
25
 
26
26
  # The horizontal alignment of the cell.
27
27
  # @note
28
- # The horizontal cell alignement style must be one of
28
+ # The horizontal cell alignment style must be one of
29
29
  # :general
30
30
  # :left
31
31
  # :center
@@ -86,34 +86,63 @@ module Axlsx
86
86
  alias :readingOrder :reading_order
87
87
 
88
88
  # @see horizontal
89
- def horizontal=(v) Axlsx.validate_horizontal_alignment v; @horizontal = v end
89
+ def horizontal=(v)
90
+ Axlsx.validate_horizontal_alignment v
91
+ @horizontal = v
92
+ end
93
+
90
94
  # @see vertical
91
- def vertical=(v) Axlsx.validate_vertical_alignment v; @vertical = v end
95
+ def vertical=(v)
96
+ Axlsx.validate_vertical_alignment v
97
+ @vertical = v
98
+ end
99
+
92
100
  # @see textRotation
93
- def text_rotation=(v) Axlsx.validate_unsigned_int v; @text_rotation = v end
101
+ def text_rotation=(v)
102
+ Axlsx.validate_unsigned_int v
103
+ @text_rotation = v
104
+ end
94
105
  alias :textRotation= :text_rotation=
95
106
 
96
107
  # @see wrapText
97
- def wrap_text=(v) Axlsx.validate_boolean v; @wrap_text = v end
108
+ def wrap_text=(v)
109
+ Axlsx.validate_boolean v
110
+ @wrap_text = v
111
+ end
98
112
  alias :wrapText= :wrap_text=
99
113
 
100
114
  # @see indent
101
- def indent=(v) Axlsx.validate_unsigned_int v; @indent = v end
115
+ def indent=(v)
116
+ Axlsx.validate_unsigned_int v
117
+ @indent = v
118
+ end
102
119
 
103
120
  # @see relativeIndent
104
- def relative_indent=(v) Axlsx.validate_int v; @relative_indent = v end
121
+ def relative_indent=(v)
122
+ Axlsx.validate_int v
123
+ @relative_indent = v
124
+ end
105
125
  alias :relativeIndent= :relative_indent=
106
126
 
107
127
  # @see justifyLastLine
108
- def justify_last_line=(v) Axlsx.validate_boolean v; @justify_last_line = v end
128
+ def justify_last_line=(v)
129
+ Axlsx.validate_boolean v
130
+ @justify_last_line = v
131
+ end
109
132
  alias :justifyLastLine= :justify_last_line=
110
133
 
111
134
  # @see shrinkToFit
112
- def shrink_to_fit=(v) Axlsx.validate_boolean v; @shrink_to_fit = v end
135
+ def shrink_to_fit=(v)
136
+ Axlsx.validate_boolean v
137
+ @shrink_to_fit = v
138
+ end
113
139
  alias :shrinkToFit= :shrink_to_fit=
114
140
 
115
141
  # @see readingOrder
116
- def reading_order=(v) Axlsx.validate_unsigned_int v; @reading_order = v end
142
+ def reading_order=(v)
143
+ Axlsx.validate_unsigned_int v
144
+ @reading_order = v
145
+ end
117
146
  alias :readingOrder= :reading_order=
118
147
 
119
148
  # Serializes the object
@@ -26,9 +26,16 @@ module Axlsx
26
26
  end
27
27
 
28
28
  # @see hidden
29
- def hidden=(v) Axlsx.validate_boolean v; @hidden = v end
29
+ def hidden=(v)
30
+ Axlsx.validate_boolean v
31
+ @hidden = v
32
+ end
33
+
30
34
  # @see locked
31
- def locked=(v) Axlsx.validate_boolean v; @locked = v end
35
+ def locked=(v)
36
+ Axlsx.validate_boolean v
37
+ @locked = v
38
+ end
32
39
 
33
40
  # Serializes the object
34
41
  # @param [String] str
@@ -8,7 +8,7 @@ module Axlsx
8
8
  include Axlsx::OptionsParser
9
9
  include Axlsx::SerializedAttributes
10
10
 
11
- # Creats a new CellStyle object
11
+ # Creates a new CellStyle object
12
12
  # @option options [String] name
13
13
  # @option options [Integer] xfId
14
14
  # @option options [Integer] buildinId
@@ -48,17 +48,40 @@ module Axlsx
48
48
  attr_reader :customBuiltin
49
49
 
50
50
  # @see name
51
- def name=(v) Axlsx.validate_string v; @name = v end
51
+ def name=(v)
52
+ Axlsx.validate_string v
53
+ @name = v
54
+ end
55
+
52
56
  # @see xfId
53
- def xfId=(v) Axlsx.validate_unsigned_int v; @xfId = v end
57
+ def xfId=(v)
58
+ Axlsx.validate_unsigned_int v
59
+ @xfId = v
60
+ end
61
+
54
62
  # @see builtinId
55
- def builtinId=(v) Axlsx.validate_unsigned_int v; @builtinId = v end
63
+ def builtinId=(v)
64
+ Axlsx.validate_unsigned_int v
65
+ @builtinId = v
66
+ end
67
+
56
68
  # @see iLivel
57
- def iLevel=(v) Axlsx.validate_unsigned_int v; @iLevel = v end
69
+ def iLevel=(v)
70
+ Axlsx.validate_unsigned_int v
71
+ @iLevel = v
72
+ end
73
+
58
74
  # @see hidden
59
- def hidden=(v) Axlsx.validate_boolean v; @hidden = v end
75
+ def hidden=(v)
76
+ Axlsx.validate_boolean v
77
+ @hidden = v
78
+ end
79
+
60
80
  # @see customBuiltin
61
- def customBuiltin=(v) Axlsx.validate_boolean v; @customBuiltin = v end
81
+ def customBuiltin=(v)
82
+ Axlsx.validate_boolean v
83
+ @customBuiltin = v
84
+ end
62
85
 
63
86
  # Serializes the object
64
87
  # @param [String] str
@@ -17,7 +17,7 @@ module Axlsx
17
17
 
18
18
  serializable_attributes :auto, :rgb, :tint
19
19
 
20
- # Determines if the color is system color dependant
20
+ # Determines if the color is system color dependent
21
21
  # @return [Boolean]
22
22
  attr_reader :auto
23
23
 
@@ -47,7 +47,10 @@ module Axlsx
47
47
  attr_reader :tint
48
48
 
49
49
  # @see auto
50
- def auto=(v) Axlsx.validate_boolean v; @auto = v end
50
+ def auto=(v)
51
+ Axlsx.validate_boolean v
52
+ @auto = v
53
+ end
51
54
 
52
55
  # @see color
53
56
  def rgb=(v)
@@ -61,12 +64,15 @@ module Axlsx
61
64
  end
62
65
 
63
66
  # @see tint
64
- def tint=(v) Axlsx.validate_float v; @tint = v end
67
+ def tint=(v)
68
+ Axlsx.validate_float v
69
+ @tint = v
70
+ end
65
71
 
66
72
  # This version does not support themes
67
73
  # def theme=(v) Axlsx::validate_unsigned_integer v; @theme = v end
68
74
 
69
- # Indexed colors are for backward compatability which I am choosing not to support
75
+ # Indexed colors are for backward compatibility which I am choosing not to support
70
76
  # def indexed=(v) Axlsx::validate_unsigned_integer v; @indexed = v end
71
77
 
72
78
  # Serializes the object
@@ -49,17 +49,40 @@ module Axlsx
49
49
  end
50
50
 
51
51
  # @see Dxf#alignment
52
- def alignment=(v) DataTypeValidator.validate "Dxf.alignment", CellAlignment, v; @alignment = v end
52
+ def alignment=(v)
53
+ DataTypeValidator.validate "Dxf.alignment", CellAlignment, v
54
+ @alignment = v
55
+ end
56
+
53
57
  # @see protection
54
- def protection=(v) DataTypeValidator.validate "Dxf.protection", CellProtection, v; @protection = v end
58
+ def protection=(v)
59
+ DataTypeValidator.validate "Dxf.protection", CellProtection, v
60
+ @protection = v
61
+ end
62
+
55
63
  # @see numFmt
56
- def numFmt=(v) DataTypeValidator.validate "Dxf.numFmt", NumFmt, v; @numFmt = v end
64
+ def numFmt=(v)
65
+ DataTypeValidator.validate "Dxf.numFmt", NumFmt, v
66
+ @numFmt = v
67
+ end
68
+
57
69
  # @see font
58
- def font=(v) DataTypeValidator.validate "Dxf.font", Font, v; @font = v end
70
+ def font=(v)
71
+ DataTypeValidator.validate "Dxf.font", Font, v
72
+ @font = v
73
+ end
74
+
59
75
  # @see border
60
- def border=(v) DataTypeValidator.validate "Dxf.border", Border, v; @border = v end
76
+ def border=(v)
77
+ DataTypeValidator.validate "Dxf.border", Border, v
78
+ @border = v
79
+ end
80
+
61
81
  # @see fill
62
- def fill=(v) DataTypeValidator.validate "Dxf.fill", Fill, v; @fill = v end
82
+ def fill=(v)
83
+ DataTypeValidator.validate "Dxf.fill", Fill, v
84
+ @fill = v
85
+ end
63
86
 
64
87
  # Serializes the object
65
88
  # @param [String] str
@@ -28,6 +28,9 @@ module Axlsx
28
28
  end
29
29
 
30
30
  # @see fill_type
31
- def fill_type=(v) DataTypeValidator.validate "Fill.fill_type", [PatternFill, GradientFill], v; @fill_type = v; end
31
+ def fill_type=(v)
32
+ DataTypeValidator.validate "Fill.fill_type", [PatternFill, GradientFill], v
33
+ @fill_type = v
34
+ end
32
35
  end
33
36
  end
@@ -33,7 +33,7 @@ module Axlsx
33
33
  # The charset of the font
34
34
  # @return [Integer]
35
35
  # @note
36
- # The following values are defined in the OOXML specification and are OS dependant values
36
+ # The following values are defined in the OOXML specification and are OS dependent values
37
37
  # 0 ANSI_CHARSET
38
38
  # 1 DEFAULT_CHARSET
39
39
  # 2 SYMBOL_CHARSET
@@ -112,15 +112,34 @@ module Axlsx
112
112
  attr_reader :sz
113
113
 
114
114
  # @see name
115
- def name=(v) Axlsx.validate_string v; @name = v end
115
+ def name=(v)
116
+ Axlsx.validate_string v
117
+ @name = v
118
+ end
119
+
116
120
  # @see charset
117
- def charset=(v) Axlsx.validate_unsigned_int v; @charset = v end
121
+ def charset=(v)
122
+ Axlsx.validate_unsigned_int v
123
+ @charset = v
124
+ end
125
+
118
126
  # @see family
119
- def family=(v) Axlsx.validate_unsigned_int v; @family = v end
127
+ def family=(v)
128
+ Axlsx.validate_unsigned_int v
129
+ @family = v
130
+ end
131
+
120
132
  # @see b
121
- def b=(v) Axlsx.validate_boolean v; @b = v end
133
+ def b=(v)
134
+ Axlsx.validate_boolean v
135
+ @b = v
136
+ end
137
+
122
138
  # @see i
123
- def i=(v) Axlsx.validate_boolean v; @i = v end
139
+ def i=(v)
140
+ Axlsx.validate_boolean v
141
+ @i = v
142
+ end
124
143
 
125
144
  # @see u
126
145
  def u=(v)
@@ -131,19 +150,46 @@ module Axlsx
131
150
  end
132
151
 
133
152
  # @see strike
134
- def strike=(v) Axlsx.validate_boolean v; @strike = v end
153
+ def strike=(v)
154
+ Axlsx.validate_boolean v
155
+ @strike = v
156
+ end
157
+
135
158
  # @see outline
136
- def outline=(v) Axlsx.validate_boolean v; @outline = v end
159
+ def outline=(v)
160
+ Axlsx.validate_boolean v
161
+ @outline = v
162
+ end
163
+
137
164
  # @see shadow
138
- def shadow=(v) Axlsx.validate_boolean v; @shadow = v end
165
+ def shadow=(v)
166
+ Axlsx.validate_boolean v
167
+ @shadow = v
168
+ end
169
+
139
170
  # @see condense
140
- def condense=(v) Axlsx.validate_boolean v; @condense = v end
171
+ def condense=(v)
172
+ Axlsx.validate_boolean v
173
+ @condense = v
174
+ end
175
+
141
176
  # @see extend
142
- def extend=(v) Axlsx.validate_boolean v; @extend = v end
177
+ def extend=(v)
178
+ Axlsx.validate_boolean v
179
+ @extend = v
180
+ end
181
+
143
182
  # @see color
144
- def color=(v) DataTypeValidator.validate "Font.color", Color, v; @color = v end
183
+ def color=(v)
184
+ DataTypeValidator.validate "Font.color", Color, v
185
+ @color = v
186
+ end
187
+
145
188
  # @see sz
146
- def sz=(v) Axlsx.validate_unsigned_int v; @sz = v end
189
+ def sz=(v)
190
+ Axlsx.validate_unsigned_int v
191
+ @sz = v
192
+ end
147
193
 
148
194
  # Serializes the object
149
195
  # @param [String] str
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Axlsx
4
- # A GradientFill defines the color and positioning for gradiant cell fill.
4
+ # A GradientFill defines the color and positioning for gradient cell fill.
5
5
  # @see Open Office XML Part 1 §18.8.24
6
6
  class GradientFill
7
7
  include Axlsx::OptionsParser
@@ -55,10 +55,16 @@ module Axlsx
55
55
  attr_reader :stop
56
56
 
57
57
  # @see type
58
- def type=(v) Axlsx.validate_gradient_type v; @type = v end
58
+ def type=(v)
59
+ Axlsx.validate_gradient_type v
60
+ @type = v
61
+ end
59
62
 
60
63
  # @see degree
61
- def degree=(v) Axlsx.validate_float v; @degree = v end
64
+ def degree=(v)
65
+ Axlsx.validate_float v
66
+ @degree = v
67
+ end
62
68
 
63
69
  # @see left
64
70
  def left=(v)
@@ -22,9 +22,16 @@ module Axlsx
22
22
  end
23
23
 
24
24
  # @see color
25
- def color=(v) DataTypeValidator.validate "GradientStop.color", Color, v; @color = v end
25
+ def color=(v)
26
+ DataTypeValidator.validate "GradientStop.color", Color, v
27
+ @color = v
28
+ end
29
+
26
30
  # @see position
27
- def position=(v) DataTypeValidator.validate "GradientStop.position", Float, v, ->(arg) { arg >= 0 && arg <= 1 }; @position = v end
31
+ def position=(v)
32
+ DataTypeValidator.validate "GradientStop.position", Float, v, ->(arg) { arg >= 0 && arg <= 1 }
33
+ @position = v
34
+ end
28
35
 
29
36
  # Serializes the object
30
37
  # @param [String] str
@@ -61,10 +61,16 @@ module Axlsx
61
61
  attr_reader :numFmtId
62
62
 
63
63
  # @see numFmtId
64
- def numFmtId=(v) Axlsx.validate_unsigned_int v; @numFmtId = v end
64
+ def numFmtId=(v)
65
+ Axlsx.validate_unsigned_int v
66
+ @numFmtId = v
67
+ end
65
68
 
66
69
  # @see formatCode
67
- def formatCode=(v) Axlsx.validate_string v; @formatCode = v end
70
+ def formatCode=(v)
71
+ Axlsx.validate_string v
72
+ @formatCode = v
73
+ end
68
74
 
69
75
  # Serializes the object
70
76
  # @param [String] str
@@ -6,6 +6,7 @@ module Axlsx
6
6
  # @see Style#add_style
7
7
  class PatternFill
8
8
  include Axlsx::OptionsParser
9
+
9
10
  # Creates a new PatternFill Object
10
11
  # @option options [Symbol] patternType
11
12
  # @option options [Color] fgColor
@@ -49,11 +50,22 @@ module Axlsx
49
50
  attr_reader :patternType
50
51
 
51
52
  # @see fgColor
52
- def fgColor=(v) DataTypeValidator.validate "PatternFill.fgColor", Color, v; @fgColor = v end
53
+ def fgColor=(v)
54
+ DataTypeValidator.validate "PatternFill.fgColor", Color, v
55
+ @fgColor = v
56
+ end
57
+
53
58
  # @see bgColor
54
- def bgColor=(v) DataTypeValidator.validate "PatternFill.bgColor", Color, v; @bgColor = v end
59
+ def bgColor=(v)
60
+ DataTypeValidator.validate "PatternFill.bgColor", Color, v
61
+ @bgColor = v
62
+ end
63
+
55
64
  # @see patternType
56
- def patternType=(v) Axlsx.validate_pattern_type v; @patternType = v end
65
+ def patternType=(v)
66
+ Axlsx.validate_pattern_type v
67
+ @patternType = v
68
+ end
57
69
 
58
70
  # Serializes the object
59
71
  # @param [String] str