Sha256: 8d994c66ae7e79ef82e4b401454452810ac592c312646a3f551022e5297e3f05

Contents?: true

Size: 1.82 KB

Versions: 27

Compression:

Stored size: 1.82 KB

Contents

require 'rubyXL/objects/ooxml_object'
require 'rubyXL/objects/simple_types'

module RubyXL

  # http://www.datypic.com/sc/ooxml/e-ssml_stop-1.html
  class Stop < OOXMLObject
    define_attribute(:position, :double, :required => true)
    define_child_node(RubyXL::Color)
    define_element_name 'stop'
  end

  # http://www.schemacentral.com/sc/ooxml/e-ssml_patternFill-1.html
  class PatternFill < OOXMLObject
    define_attribute(:patternType, RubyXL::ST_PatternType)
    define_child_node(RubyXL::Color, :node_name => :fgColor )
    define_child_node(RubyXL::Color, :node_name => :bgColor )
    define_element_name 'patternFill'
  end

  # http://www.schemacentral.com/sc/ooxml/e-ssml_gradientFill-1.html
  class GradientFill < OOXMLObject
    define_attribute(:type,   RubyXL::ST_GradientType, :default => 'linear')
    define_attribute(:degree, :double, :default => 0)
    define_attribute(:left,   :double, :default => 0)
    define_attribute(:right,  :double, :default => 0)
    define_attribute(:top,    :double, :default => 0)
    define_attribute(:bottom, :double, :default => 0)
    define_child_node(RubyXL::Stop, :collection => true)
    define_element_name 'gradientFill'
  end

  # http://www.schemacentral.com/sc/ooxml/e-ssml_fill-1.html
  class Fill < OOXMLObject
    define_child_node(RubyXL::PatternFill)
    define_child_node(RubyXL::GradientFill)
    define_element_name 'fill'

    def self.default(pattern_type)
      self.new(:pattern_fill => RubyXL::PatternFill.new(:pattern_type => pattern_type))
    end

  end

  # http://www.schemacentral.com/sc/ooxml/e-ssml_fills-1.html
  class Fills < OOXMLContainerObject
    define_child_node(RubyXL::Fill, :collection => :with_count)
    define_element_name 'fills'

    def self.default
      self.new(:_ => [ RubyXL::Fill.default('none'), RubyXL::Fill.default('gray125') ])
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
rubyXL-3.3.25 lib/rubyXL/objects/fill.rb
rubyXL-3.3.24 lib/rubyXL/objects/fill.rb
rubyXL-3.3.23 lib/rubyXL/objects/fill.rb
rubyXL-3.3.22 lib/rubyXL/objects/fill.rb
rubyXL-3.3.21 lib/rubyXL/objects/fill.rb
rubyXL-3.3.20 lib/rubyXL/objects/fill.rb
rubyXL-3.3.19 lib/rubyXL/objects/fill.rb
rubyXL-3.3.18 lib/rubyXL/objects/fill.rb
rubyXL-3.3.17 lib/rubyXL/objects/fill.rb
rubyXL-3.3.16 lib/rubyXL/objects/fill.rb
rubyXL-3.3.15 lib/rubyXL/objects/fill.rb
rubyXL-3.3.14 lib/rubyXL/objects/fill.rb
rubyXL-3.3.13 lib/rubyXL/objects/fill.rb
rubyXL-3.3.12 lib/rubyXL/objects/fill.rb
rubyXL-3.3.11 lib/rubyXL/objects/fill.rb
rubyXL-3.3.10 lib/rubyXL/objects/fill.rb
rubyXL-3.3.9 lib/rubyXL/objects/fill.rb
rubyXL-3.3.8 lib/rubyXL/objects/fill.rb
rubyXL-3.3.7 lib/rubyXL/objects/fill.rb
rubyXL-3.3.6 lib/rubyXL/objects/fill.rb