Class: OoxmlParser::GraphicFrame
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::GraphicFrame
- Defined in:
- lib/ooxml_parser/pptx_parser/presentation/slide/graphic_frame/graphic_frame.rb
Overview
Class for parsing ‘graphicFrame`
Instance Attribute Summary collapse
-
#graphic_data ⇒ Object
Returns the value of attribute graphic_data.
-
#non_visual_properties ⇒ NonVisualShapeProperties
Non visual properties.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#transform ⇒ Object
Returns the value of attribute transform.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(graphic_data = [], parent: nil) ⇒ GraphicFrame
constructor
A new instance of GraphicFrame.
-
#parse(node) ⇒ GraphicFrame
Parse GraphicFrame object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(graphic_data = [], parent: nil) ⇒ GraphicFrame
Returns a new instance of GraphicFrame.
12 13 14 15 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/graphic_frame/graphic_frame.rb', line 12 def initialize(graphic_data = [], parent: nil) @graphic_data = graphic_data super(parent: parent) end |
Instance Attribute Details
#graphic_data ⇒ Object
Returns the value of attribute graphic_data.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/graphic_frame/graphic_frame.rb', line 8 def graphic_data @graphic_data end |
#non_visual_properties ⇒ NonVisualShapeProperties
Returns non visual properties.
10 11 12 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/graphic_frame/graphic_frame.rb', line 10 def non_visual_properties @non_visual_properties end |
#properties ⇒ Object
Returns the value of attribute properties.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/graphic_frame/graphic_frame.rb', line 8 def properties @properties end |
#transform ⇒ Object
Returns the value of attribute transform.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/graphic_frame/graphic_frame.rb', line 8 def transform @transform end |
Instance Method Details
#parse(node) ⇒ GraphicFrame
Parse GraphicFrame object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/graphic_frame/graphic_frame.rb', line 20 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'xfrm' @transform = DocxShapeSize.new(parent: self).parse(node_child) when 'graphic' graphic_data = [] node_child.xpath('*').each do |node_child_child| case node_child_child.name when 'graphicData' node_child_child.xpath('*').each do |graphic_node_child| case graphic_node_child.name when 'tbl' graphic_data << Table.new(parent: self).parse(graphic_node_child) when 'chart' @chart_reference = ChartReference.new(parent: self).parse(graphic_node_child) root_object.add_to_xmls_stack(root_object.get_link_from_rels(@chart_reference.id)) graphic_data << Chart.new(parent: self).parse root_object.xmls_stack.pop when 'oleObj' graphic_data << OleObject.new(parent: self).parse(graphic_node_child) end end end end @graphic_data = graphic_data when 'nvGraphicFramePr' @non_visual_properties = NonVisualShapeProperties.new(parent: self).parse(node_child) end end self end |