Sha256: ddd3262e0d94d4d84bef0fd5414060412b2e8f566ec81f1a64b120220e3c38dd

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# encoding: UTF-8
module Axlsx
  # 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
  class Fill

    # The type of fill
    # @return [PatternFill, GradientFill]
    attr_reader :fill_type

    # 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
    def initialize(fill_type)
      self.fill_type = fill_type
    end

    # Serializes the object
    # @param [String] str
    # @return [String]
    def to_xml_string(str = '')
      str << '<fill>'
      @fill_type.to_xml_string(str)
      str << '</fill>'
    end

    # @see fill_type
    def fill_type=(v) DataTypeValidator.validate "Fill.fill_type", [PatternFill, GradientFill], v; @fill_type = v; end


  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caxlsx-3.2.0 lib/axlsx/stylesheet/fill.rb