Class: Sablon::HTMLConverter::Text
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(string, format) ⇒ Text
constructor
A new instance of Text.
- #inspect ⇒ Object
- #to_docx ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(string, format) ⇒ Text
Returns a new instance of Text.
147 148 149 150 |
# File 'lib/sablon/html/ast.rb', line 147 def initialize(string, format) @string = string @format = format end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
146 147 148 |
# File 'lib/sablon/html/ast.rb', line 146 def string @string end |
Instance Method Details
#inspect ⇒ Object
156 157 158 |
# File 'lib/sablon/html/ast.rb', line 156 def inspect "<Text{#{@format.inspect}}: #{string}>" end |
#to_docx ⇒ Object
152 153 154 |
# File 'lib/sablon/html/ast.rb', line 152 def to_docx "<w:r>#{@format.to_docx}<w:t xml:space=\"preserve\">#{normalized_string}</w:t></w:r>" end |