Class: OoxmlParser::XlsxDrawing

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

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#fromXlsxDrawingPositionParameters

Returns position from.

Returns:



6
7
8
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb', line 6

def from
  @from
end

#graphic_frameGraphicFrame

Returns graphic frame.

Returns:



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

def graphic_frame
  @graphic_frame
end

#groupingObject

Returns the value of attribute grouping.



4
5
6
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb', line 4

def grouping
  @grouping
end

#pictureObject

Returns the value of attribute picture.



4
5
6
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb', line 4

def picture
  @picture
end

#shapeObject

Returns the value of attribute shape.



4
5
6
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb', line 4

def shape
  @shape
end

#toXlsxDrawingPositionParameters

Returns position to.

Returns:



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

def to
  @to
end

Instance Method Details

#parse(node) ⇒ XlsxDrawing

Parse XlsxDrawing object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb', line 15

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