Class: OoxmlParser::TextField
- Inherits:
-
Object
- Object
- OoxmlParser::TextField
- Defined in:
- lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#text ⇒ Object
Returns the value of attribute text.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb', line 3 def id @id end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb', line 3 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb', line 3 def type @type end |
Class Method Details
.parse(text_field_node) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb', line 5 def self.parse(text_field_node) text_field = TextField.new text_field.id = text_field_node.attribute('id').value text_field.type = text_field_node.attribute('type').value text_field_node.xpath('*').each do |text_field_node_child| case text_field_node_child.name when 't' text_field.text = text_field_node_child.text end end text_field end |