Sha256: 9d633219bfbfe971733a2bde51035f11f10be91bdfdbf3c6fe307009c10093f7

Contents?: true

Size: 1003 Bytes

Versions: 39

Compression:

Stored size: 1003 Bytes

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

39 entries across 39 versions & 6 rubygems

Version Path
caxlsx-3.3.0 lib/axlsx/stylesheet/fill.rb
caxlsx-3.1.1 lib/axlsx/stylesheet/fill.rb
caxlsx-3.1.0 lib/axlsx/stylesheet/fill.rb
bonio-axlsx-2.2.3 lib/axlsx/stylesheet/fill.rb
caxlsx-3.0.4 lib/axlsx/stylesheet/fill.rb
caxlsx-3.0.3 lib/axlsx/stylesheet/fill.rb
caxlsx-3.0.2 lib/axlsx/stylesheet/fill.rb
caxlsx-2.0.2 lib/axlsx/stylesheet/fill.rb
caxlsx-3.0.1 lib/axlsx/stylesheet/fill.rb
caxlsx-3.0.0 lib/axlsx/stylesheet/fill.rb
axlsx-alt-3.0.1 lib/axlsx/stylesheet/fill.rb
axlsx-alt-3.0.0 lib/axlsx/stylesheet/fill.rb
axlsx-3.0.0.pre lib/axlsx/stylesheet/fill.rb
bonio-axlsx-2.2.2 lib/axlsx/stylesheet/fill.rb
bonio-axlsx-2.2.1 lib/axlsx/stylesheet/fill.rb
dg-axlsx-2.1.0 lib/axlsx/stylesheet/fill.rb
axlsx-2.1.0.pre lib/axlsx/stylesheet/fill.rb
l_axlsx-2.0.1 lib/axlsx/stylesheet/fill.rb
axlsx-2.0.1 lib/axlsx/stylesheet/fill.rb
axlsx-2.0.0 lib/axlsx/stylesheet/fill.rb