Class: Sablon::HTMLConverter::Paragraph

Inherits:
Node
  • Object
show all
Defined in:
lib/sablon/html/ast.rb

Direct Known Subclasses

ListParagraph

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

Instance Method Summary collapse

Methods inherited from Node

node_name

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

#runsObject

Returns the value of attribute runs.



48
49
50
# File 'lib/sablon/html/ast.rb', line 48

def runs
  @runs
end

#styleObject

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

#inspectObject



72
73
74
# File 'lib/sablon/html/ast.rb', line 72

def inspect
  "<Paragraph{#{style}}: #{runs.inspect}>"
end

#to_docxObject



63
64
65
# File 'lib/sablon/html/ast.rb', line 63

def to_docx
  PATTERN % [style, ppr_docx, runs.to_docx]
end