Method: DocTemplate::Tags::PositionTag#parse_table

Defined in:
lib/doc_template/tags/position_tag.rb

#parse_table(table) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/doc_template/tags/position_tag.rb', line 9

def parse_table(table)
  table.remove && return unless @opts[:parent_tags].try(:include?, Tags::MaterialsTag::TAG_NAME)

  params = {
    content: table.at_xpath('.//tr[2]/td').inner_html,
    position: @opts[:value].strip
  }

  content = parse_template params, TEMPLATE
  @content = parse_nested(content, @opts)
  replace_tag table
end