Class: OoxmlParser::DocxDrawingDistanceFromText
- Inherits:
-
Object
- Object
- OoxmlParser::DocxDrawingDistanceFromText
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb
Instance Attribute Summary collapse
-
#bottom ⇒ Object
Returns the value of attribute bottom.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
-
#top ⇒ Object
Returns the value of attribute top.
Class Method Summary collapse
Instance Attribute Details
#bottom ⇒ Object
Returns the value of attribute bottom.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb', line 4 def bottom @bottom end |
#left ⇒ Object
Returns the value of attribute left.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb', line 4 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb', line 4 def right @right end |
#top ⇒ Object
Returns the value of attribute top.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb', line 4 def top @top end |
Class Method Details
.parse(distance_node) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb', line 6 def self.parse(distance_node) distance_from_text = DocxDrawingDistanceFromText.new distance_node.attributes.each do |key, value| case key when 'distT' distance_from_text.top = (value.value.to_f / 360_000.0).round(2) when 'distB' distance_from_text.bottom = (value.value.to_f / 360_000.0).round(2) when 'distL' distance_from_text.left = (value.value.to_f / 360_000.0).round(2) when 'distR' distance_from_text.right = (value.value.to_f / 360_000.0).round(2) end end distance_from_text end |