class OoxmlParser::PatternFill

Parsing ‘patternFill` tag

Attributes

background_color[RW]

@return [Color] background color

foreground_color[RW]

@return [Color] foreground color

pattern_type[RW]

@return [String] pattern type

Public Instance Methods

parse(node) click to toggle source

Parse PatternFill data @param [Nokogiri::XML:Element] node with PatternFill data @return [PatternFill] value of PatternFill data

# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet/fills/fill/pattern_fill.rb, line 16
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'patternType'
      @pattern_type = value.value.to_sym
    end
  end

  node.xpath('*').each do |node_child|
    case node_child.name
    when 'fgColor'
      @foreground_color = OoxmlColor.new(parent: self).parse(node_child)
    when 'bgColor'
      @background_color = OoxmlColor.new(parent: self).parse(node_child)
    end
  end
  self
end