class OoxmlParser::GradientColor
Class for parsing ‘gradFill` tags
Attributes
@return [LinearGradient] content of Linear Gradient
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb, line 12 def initialize(parent: nil) @gradient_stops = [] super end
Calls superclass method
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb, line 20 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'gsLst' node_child.xpath('*').each do |gradient_stop_node| @gradient_stops << GradientStop.new(parent: self).parse(gradient_stop_node) end when 'path' @path = node_child.attribute('path').value.to_sym when 'lin' @linear_gradient = LinearGradient.new(parent: self).parse(node_child) end end self end
Parse GradientColor
object @param node [Nokogiri::XML:Element] node to parse @return [GradientColor] result of parsing