Class: Dri::Utils::MarkdownLists

Inherits:
Object
  • Object
show all
Defined in:
lib/dri/utils/markdown_lists.rb

Class Method Summary collapse

Class Method Details

.make_list(labels, items) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/dri/utils/markdown_lists.rb', line 6

def self.make_list(labels, items)
  list = items.each_with_object([]) do |item, arr|
    item.zip(labels).each do |element, label|
      arr << "<li><b>#{label}</b>:<br> #{element}</li>"
    end
    arr << "<hr>"
  end

  "<ul>#{list.join}</ul>"
end