Class: OoxmlParser::XlsxDrawing

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb

Overview

Data of spreadsheet drawing

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#client_dataClientData

Returns client data.

Returns:



16
17
18
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 16

def client_data
  @client_data
end

#fromXlsxDrawingPositionParameters

Returns position from.

Returns:



10
11
12
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 10

def from
  @from
end

#graphic_frameGraphicFrame

Returns graphic frame.

Returns:



14
15
16
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 14

def graphic_frame
  @graphic_frame
end

#groupingObject

Returns the value of attribute grouping.



8
9
10
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 8

def grouping
  @grouping
end

#pictureObject

Returns the value of attribute picture.



8
9
10
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 8

def picture
  @picture
end

#shapeObject

Returns the value of attribute shape.



8
9
10
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 8

def shape
  @shape
end

#toXlsxDrawingPositionParameters

Returns position to.

Returns:



12
13
14
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 12

def to
  @to
end

Instance Method Details

#parse(node) ⇒ XlsxDrawing

Parse XlsxDrawing object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_drawing.rb', line 21

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)
    when 'clientData'
      @client_data = ClientData.new(parent: self).parse(child_node)
    end
  end
  self
end