class Axlsx::Fill
The Fill
is a formatting object that manages the background color, and pattern for cells. @note The recommended way to manage styles in your workbook is to use Styles#add_style
. @see Styles#add_style
@see PatternFill
@see GradientFill
Attributes
fill_type[R]
The type of fill @return [PatternFill, GradientFill]
Public Class Methods
new(fill_type)
click to toggle source
Creates a new Fill
object @param [PatternFill, GradientFill] fill_type
@raise [ArgumentError] if the fill_type
parameter is not a PatternFill
or a GradientFill
instance
# File lib/axlsx/stylesheet/fill.rb, line 17 def initialize(fill_type) self.fill_type = fill_type end
Public Instance Methods
fill_type=(v)
click to toggle source
@see fill_type
# File lib/axlsx/stylesheet/fill.rb, line 31 def fill_type=(v) DataTypeValidator.validate "Fill.fill_type", [PatternFill, GradientFill], v; @fill_type = v; end
to_xml_string(str = '')
click to toggle source
Serializes the object @param [String] str @return [String]
# File lib/axlsx/stylesheet/fill.rb, line 24 def to_xml_string(str = '') str << '<fill>' @fill_type.to_xml_string(str) str << '</fill>' end