Class: Sablon::HTMLConverter::Collection
- Defined in:
- lib/sablon/html/ast.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(nodes) ⇒ Collection
constructor
A new instance of Collection.
- #inspect ⇒ Object
- #to_docx ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(nodes) ⇒ Collection
Returns a new instance of Collection.
15 16 17 |
# File 'lib/sablon/html/ast.rb', line 15 def initialize(nodes) @nodes = nodes end |
Instance Attribute Details
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
14 15 16 |
# File 'lib/sablon/html/ast.rb', line 14 def nodes @nodes end |
Instance Method Details
#accept(visitor) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/sablon/html/ast.rb', line 19 def accept(visitor) super @nodes.each do |node| node.accept(visitor) end end |
#inspect ⇒ Object
30 31 32 |
# File 'lib/sablon/html/ast.rb', line 30 def inspect "[#{nodes.map(&:inspect).join(', ')}]" end |
#to_docx ⇒ Object
26 27 28 |
# File 'lib/sablon/html/ast.rb', line 26 def to_docx nodes.map(&:to_docx).join end |