Class: Sablon::HTMLConverter::Run
Overview
Create a run of text in the document, runs cannot be nested within each other
Direct Known Subclasses
Constant Summary collapse
- PROPERTIES =
%w[b i caps color dstrike emboss imprint highlight outline rStyle shadow shd smallCaps strike sz u vanish vertAlign rFonts].freeze
Instance Method Summary collapse
-
#initialize(_env, node, properties) ⇒ Run
constructor
A new instance of Run.
- #inspect ⇒ Object
- #to_docx ⇒ Object
Methods inherited from Node
#accept, convert_style_property, node_name, process_properties, style_conversion
Constructor Details
#initialize(_env, node, properties) ⇒ Run
Returns a new instance of Run.
485 486 487 488 489 490 |
# File 'lib/sablon/html/ast.rb', line 485 def initialize(_env, node, properties) super properties = self.class.process_properties(properties) @properties = NodeProperties.run(properties) @string = node.to_s # using `text` doesn't reconvert HTML entities end |
Instance Method Details
#inspect ⇒ Object
496 497 498 |
# File 'lib/sablon/html/ast.rb', line 496 def inspect "<Run{#{@properties.inspect}}: #{@string}>" end |
#to_docx ⇒ Object
492 493 494 |
# File 'lib/sablon/html/ast.rb', line 492 def to_docx super('w:r') end |