Class: OoxmlParser::Inserted
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Inserted
- Defined in:
- lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/inserted.rb
Overview
Class for parsing ‘w:ins` tag - Inserted Run Content
Instance Attribute Summary collapse
-
#author ⇒ String
Author of insert.
-
#date ⇒ Date
Date of insert.
-
#id ⇒ Integer
Id of inserted.
-
#run ⇒ ParagraphRun
Inserted run.
-
#user_id ⇒ String
Id of user.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ Inserted
Parse Inserted object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#author ⇒ String
Returns author of insert.
11 12 13 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/inserted.rb', line 11 def @author end |
#date ⇒ Date
Returns date of insert.
13 14 15 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/inserted.rb', line 13 def date @date end |
#id ⇒ Integer
Returns id of inserted.
9 10 11 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/inserted.rb', line 9 def id @id end |
#run ⇒ ParagraphRun
Returns inserted run.
17 18 19 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/inserted.rb', line 17 def run @run end |
#user_id ⇒ String
Returns id of user.
15 16 17 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/inserted.rb', line 15 def user_id @user_id end |
Instance Method Details
#parse(node) ⇒ Inserted
Parse Inserted object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/inserted.rb', line 22 def parse(node) node.attributes.each do |key, value| case key when 'id' @id = value.value.to_i when 'author' @author = value.value.to_s when 'date' @date = parse_date(value.value.to_s) when 'oouserid' @user_id = value.value.to_s end end node.xpath('*').each do |node_child| case node_child.name when 'r' @run = ParagraphRun.new(parent: self).parse(node_child) end end self end |