Class: OoxmlParser::DocxWrapDrawing
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DocxWrapDrawing
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb
Overview
Docx Wrap Drawing
Instance Attribute Summary collapse
-
#distance_from_text ⇒ Object
Returns the value of attribute distance_from_text.
-
#wrap_text ⇒ Object
Returns the value of attribute wrap_text.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ DocxWrapDrawing
constructor
A new instance of DocxWrapDrawing.
-
#parse(node) ⇒ DocxWrapDrawing
Parse DocxWrapDrawing object.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ DocxWrapDrawing
Returns a new instance of DocxWrapDrawing.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb', line 6 def initialize(parent: nil) @wrap_text = :none @parent = parent end |
Instance Attribute Details
#distance_from_text ⇒ Object
Returns the value of attribute distance_from_text.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb', line 4 def distance_from_text @distance_from_text end |
#wrap_text ⇒ Object
Returns the value of attribute wrap_text.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb', line 4 def wrap_text @wrap_text end |
Instance Method Details
#parse(node) ⇒ DocxWrapDrawing
Parse DocxWrapDrawing object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb', line 14 def parse(node) unless node.attribute('behindDoc').nil? @wrap_text = :behind if node.attribute('behindDoc').value == '1' @wrap_text = :infront if node.attribute('behindDoc').value == '0' end node.xpath('*').each do |node_child| case node_child.name when 'wrapSquare' @wrap_text = :square @distance_from_text = DocxDrawingDistanceFromText.new(parent: self).parse(node_child) break when 'wrapTight' @wrap_text = :tight @distance_from_text = DocxDrawingDistanceFromText.new(parent: self).parse(node_child) break when 'wrapThrough' @wrap_text = :through @distance_from_text = DocxDrawingDistanceFromText.new(parent: self).parse(node_child) break when 'wrapTopAndBottom' @wrap_text = :topbottom @distance_from_text = DocxDrawingDistanceFromText.new(parent: self).parse(node_child) break end end self end |