Class: OoxmlParser::TextBody
- Inherits:
-
Object
- Object
- OoxmlParser::TextBody
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb
Instance Attribute Summary collapse
-
#paragraphs ⇒ Object
Returns the value of attribute paragraphs.
-
#properties ⇒ Object
Returns the value of attribute properties.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(properties = nil, paragraphs = []) ⇒ TextBody
constructor
A new instance of TextBody.
Constructor Details
#initialize(properties = nil, paragraphs = []) ⇒ TextBody
Returns a new instance of TextBody.
5 6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb', line 5 def initialize(properties = nil, paragraphs = []) @properties = properties @paragraphs = paragraphs end |
Instance Attribute Details
#paragraphs ⇒ Object
Returns the value of attribute paragraphs.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb', line 3 def paragraphs @paragraphs end |
#properties ⇒ Object
Returns the value of attribute properties.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb', line 3 def properties @properties end |
Class Method Details
.parse(text_body_node) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb', line 10 def self.parse(text_body_node) text_body = TextBody.new text_body_node.xpath('*').each do |text_body_node_child| case text_body_node_child.name when 'p' text_body.paragraphs << Paragraph.parse(text_body_node_child) when 'bodyPr' text_body.properties = OOXMLShapeBodyProperties.parse(text_body_node_child) end end text_body end |