Class: Sablon::HTMLConverter::Paragraph
- Defined in:
- lib/sablon/html/ast.rb
Direct Known Subclasses
Constant Summary collapse
- PATTERN =
<<-XML.gsub("\n", "") <w:p> <w:pPr> <w:pStyle w:val="%s" /> %s </w:pPr> %s </w:p> XML
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
Returns a new instance of 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 |