Class: OoxmlParser::FormTextProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::FormTextProperties
- Defined in:
- lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_text_properties.rb
Overview
Class for parsing ‘textFormPr` tag
Instance Attribute Summary collapse
-
#autofit ⇒ True, False
readonly
Specifies if size of field should be autofit.
-
#comb ⇒ FormTextComb
readonly
Parameters of text justification.
-
#format ⇒ FormTextFormat
readonly
Text format.
-
#maximum_characters ⇒ ValuedChild
readonly
Characters limit.
-
#multiline ⇒ True, False
readonly
Specifies if field is multiline.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ FormTextProperties
Parse FormTextProperties 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
#autofit ⇒ True, False (readonly)
Returns specifies if size of field should be autofit.
11 12 13 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_text_properties.rb', line 11 def autofit @autofit end |
#comb ⇒ FormTextComb (readonly)
Returns parameters of text justification.
13 14 15 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_text_properties.rb', line 13 def comb @comb end |
#format ⇒ FormTextFormat (readonly)
Returns text format.
17 18 19 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_text_properties.rb', line 17 def format @format end |
#maximum_characters ⇒ ValuedChild (readonly)
Returns characters limit.
15 16 17 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_text_properties.rb', line 15 def maximum_characters @maximum_characters end |
#multiline ⇒ True, False (readonly)
Returns specifies if field is multiline.
9 10 11 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_text_properties.rb', line 9 def multiline @multiline end |
Instance Method Details
#parse(node) ⇒ FormTextProperties
Parse FormTextProperties 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/sdt/sdt_properties/form_text_properties.rb', line 22 def parse(node) node.attributes.each do |key, value| case key when 'multiLine' @multiline = boolean_attribute_value(value) when 'autoFit' @autofit = boolean_attribute_value(value) end end node.xpath('*').each do |node_child| case node_child.name when 'comb' @comb = FormTextComb.new(parent: self).parse(node_child) when 'maxCharacters' @maximum_characters = ValuedChild.new(:integer, parent: self).parse(node_child) when 'format' @format = FormTextFormat.new(parent: self).parse(node_child) end end self end |