Sha256: 0fdd2a63d76d9aa0a26a3398c1e8ecd223446a1bb9ccd8402c3e7ef00b9002b5

Contents?: true

Size: 1.38 KB

Versions: 28

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

require_relative 'xlsx_drawing/xlsx_drawing_position_parameters'
module OoxmlParser
  # Data of spreadsheet drawing
  class XlsxDrawing < OOXMLDocumentObject
    attr_accessor :picture, :shape, :grouping
    # @return [XlsxDrawingPositionParameters] position from
    attr_accessor :from
    # @return [XlsxDrawingPositionParameters] position to
    attr_accessor :to
    # @return [GraphicFrame] graphic frame
    attr_accessor :graphic_frame

    # Parse XlsxDrawing object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [XlsxDrawing] result of parsing
    def parse(node)
      node.xpath('*').each do |child_node|
        case child_node.name
        when 'from'
          @from = XlsxDrawingPositionParameters.new(parent: self).parse(child_node)
        when 'to'
          @to = XlsxDrawingPositionParameters.new(parent: self).parse(child_node)
        when 'sp'
          @shape = DocxShape.new(parent: self).parse(child_node)
        when 'grpSp'
          @grouping = ShapesGrouping.new(parent: self).parse(child_node)
        when 'pic'
          @picture = DocxPicture.new(parent: self).parse(child_node)
        when 'graphicFrame'
          @graphic_frame = GraphicFrame.new(parent: self).parse(child_node)
        when 'cxnSp'
          @shape = ConnectionShape.new(parent: self).parse(child_node)
        end
      end
      self
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ooxml_parser-0.21.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.20.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.19.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.18.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.18.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.17.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.16.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.15.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.14.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.14.1-mingw32 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.14.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.14.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.13.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.12.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.12.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.12.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.11.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.10.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.9.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb
ooxml_parser-0.9.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb