class MdParser::HashTableVisitor

Public Instance Methods

table_to_h(titles, rows) click to toggle source
# File lib/md_parser/hash_table_visitor.rb, line 4
def table_to_h(titles, rows)
  rows.map{|row| row.each.with_index.each_with_object({}){|(cell, index), h| h[titles[index]] = cell}} 
end
visit_table(titles, rows) click to toggle source
# File lib/md_parser/hash_table_visitor.rb, line 8
def visit_table(titles, rows)
  table_to_h(titles, rows)
end