Class: Sablon::HTMLConverter::TableRow

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

Overview

Converts html table rows into wordML table rows

Constant Summary collapse

PROPERTIES =
%w[cantSplit hidden jc tblCellSpacing tblHeader
trHeight tblPrEx].freeze

Instance Method Summary collapse

Methods inherited from Node

convert_style_property, node_name, process_properties, style_conversion

Constructor Details

#initialize(env, node, properties) ⇒ TableRow

Returns a new instance of TableRow.



357
358
359
360
361
362
363
364
365
# File 'lib/sablon/html/ast.rb', line 357

def initialize(env, node, properties)
  super
  properties = self.class.process_properties(properties)
  @properties = NodeProperties.table_row(properties)
  #
  trans_props = transferred_properties
  @children = ASTBuilder.html_to_ast(env, node.children, trans_props)
  @children = Collection.new(@children)
end

Instance Method Details

#accept(visitor) ⇒ Object



371
372
373
374
# File 'lib/sablon/html/ast.rb', line 371

def accept(visitor)
  super
  @children.accept(visitor)
end

#inspectObject



376
377
378
# File 'lib/sablon/html/ast.rb', line 376

def inspect
  "<TableRow{#{@properties.inspect}}: #{@children.inspect}>"
end

#to_docxObject



367
368
369
# File 'lib/sablon/html/ast.rb', line 367

def to_docx
  super('w:tr')
end