Class: Sablon::HTMLConverter::Paragraph
- Defined in:
- lib/sablon/html/ast.rb
Direct Known Subclasses
Constant Summary collapse
- PATTERN =
"<w:p>\n<w:pPr>\n<w:pStyle w:val=\"%s\" />\n%s\n</w:pPr>\n%s\n</w:p>\n".gsub("\n", "")
Instance Attribute Summary collapse
-
#runs ⇒ Object
Returns the value of attribute runs.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(style, runs) ⇒ Paragraph
constructor
A new instance of Paragraph.
- #inspect ⇒ Object
- #to_docx ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(style, runs) ⇒ Paragraph
49 50 51 |
# File 'lib/sablon/html/ast.rb', line 49 def initialize(style, runs) @style, @runs = style, runs end |
Instance Attribute Details
#runs ⇒ Object
Returns the value of attribute runs.
48 49 50 |
# File 'lib/sablon/html/ast.rb', line 48 def runs @runs end |
#style ⇒ Object
Returns the value of attribute style.
48 49 50 |
# File 'lib/sablon/html/ast.rb', line 48 def style @style end |
Instance Method Details
#accept(visitor) ⇒ Object
67 68 69 70 |
# File 'lib/sablon/html/ast.rb', line 67 def accept(visitor) super runs.accept(visitor) end |
#inspect ⇒ Object
72 73 74 |
# File 'lib/sablon/html/ast.rb', line 72 def inspect "<Paragraph{#{style}}: #{runs.inspect}>" end |
#to_docx ⇒ Object
63 64 65 |
# File 'lib/sablon/html/ast.rb', line 63 def to_docx PATTERN % [style, ppr_docx, runs.to_docx] end |