Sha256: cd32148a5a1e580c8d5a882b183f34d431cdc3f8460e9d932bf8b11ae4a770b9

Contents?: true

Size: 837 Bytes

Versions: 4

Compression:

Stored size: 837 Bytes

Contents

require_relative 'non_visual_properties/shape_placeholder'
module OoxmlParser
  # Class for parsing `nvPr` object
  class NonVisualProperties < OOXMLDocumentObject
    attr_accessor :placeholder, :is_photo, :user_drawn

    # Parse NonVisualProperties object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [NonVisualProperties] result of parsing
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'isPhoto'
          @is_photo = attribute_enabled?(value)
        when 'userDrawn'
          @user_drawn = attribute_enabled?(value)
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'ph'
          @placeholder = ShapePlaceholder.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb
ooxml_parser-0.4.0 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb
ooxml_parser-0.3.0 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb
ooxml_parser-0.2.0 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb