3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/rack/app/front_end/helpers/table.rb', line 3
def table_by(array_of_hash)
= array_of_hash.reduce([]) do |trs, hash|
trs.push(*hash.keys)
trs.uniq!
trs
end
o = Object.new
o.extend(Rack::App::FrontEnd::Helpers::HtmlDsl)
table_html = o.__send__ :table_tag do
tr_tag do
.each do ||
td_tag String()
end
end
array_of_hash.each do |hash|
tr_tag do
.each do ||
td_tag String(hash[])
end
end
end
end
table_html
end
|