Class: OoxmlParser::ParagraphRun
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ParagraphRun
- Defined in:
- lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb
Constant Summary
Constants inherited from OOXMLDocumentObject
OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA
Instance Attribute Summary collapse
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#text ⇒ Object
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(properties = RunProperties.new, text = '') ⇒ ParagraphRun
constructor
A new instance of ParagraphRun.
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
#initialize(properties = RunProperties.new, text = '') ⇒ ParagraphRun
Returns a new instance of ParagraphRun.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb', line 6 def initialize(properties = RunProperties.new, text = '') @properties = properties @text = text end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb', line 4 def properties @properties end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb', line 4 def text @text end |
Class Method Details
.parse(character_node) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb', line 11 def self.parse(character_node) character = ParagraphRun.new character_node.xpath('*').each do |character_node_child| case character_node_child.name when 'rPr' character.properties = RunProperties.parse(character_node_child) when 't' character.text = character_node_child.text end end character end |