apollo-crawler 0.0.42 → 0.0.43
Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,23 @@ module Apollo
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.format(obj)
|
14
|
-
|
14
|
+
headings = []
|
15
|
+
if(obj[:data].length > 0)
|
16
|
+
headings = obj[:data][0].keys
|
17
|
+
end
|
18
|
+
|
19
|
+
rows = []
|
20
|
+
obj[:data].each do |line|
|
21
|
+
data = []
|
22
|
+
headings.each do |column|
|
23
|
+
data << line[column]
|
24
|
+
end
|
25
|
+
|
26
|
+
rows << data
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
table = Terminal::Table.new :headings => headings, :rows => rows
|
15
31
|
return table
|
16
32
|
end
|
17
33
|
end
|