Sha256: 98b39e186d8342b76bf20926f9cf03801f4f0e6c65e99c6974a400ce263b4f0c
Contents?: true
Size: 1.07 KB
Versions: 8
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true require_relative 'gradient_color/gradient_stop' require_relative 'gradient_color/linear_gradient' module OoxmlParser # Class for parsing `gradFill` tags class GradientColor < OOXMLDocumentObject attr_accessor :gradient_stops, :path # @return [LinearGradient] content of Linear Gradient attr_accessor :linear_gradient def initialize(parent: nil) @gradient_stops = [] @parent = parent end # Parse GradientColor object # @param node [Nokogiri::XML:Element] node to parse # @return [GradientColor] result of parsing 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 end end
Version data entries
8 entries across 8 versions & 1 rubygems