Class: OoxmlParser::TextOutline

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb

Constant Summary

Constants inherited from OOXMLDocumentObject

OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, copy_media_file, current_xml, dir, encrypted_file?, get_link_from_rels, media_folder, option_enabled?, unzip_file

Constructor Details

#initializeTextOutline

Returns a new instance of TextOutline.



6
7
8
9
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb', line 6

def initialize
  @width = 0
  @color_scheme = :none
end

Instance Attribute Details

#color_schemeObject

Returns the value of attribute color_scheme.



4
5
6
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb', line 4

def color_scheme
  @color_scheme
end

#widthObject

Returns the value of attribute width.



4
5
6
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb', line 4

def width
  @width
end

Class Method Details

.parse(node) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb', line 11

def self.parse(node)
  text_outline = TextOutline.new

  unless node.attribute('w').nil?
    text_outline.width = (node.attribute('w').value.to_f / 12_699).round(2)
  end

  text_outline.color_scheme = DocxColorScheme.parse(node)
  text_outline
end