Class: Veye::Github::ListTable

Inherits:
BaseTable show all
Defined in:
lib/veye/views/github/list_table.rb

Instance Method Summary collapse

Methods inherited from BaseTable

#after, #before

Constructor Details

#initializeListTable

Returns a new instance of ListTable.



6
7
8
9
10
# File 'lib/veye/views/github/list_table.rb', line 6

def initialize
  headings = %w(index fullname language owner_login owner_type private
                fork branches imported)
  super("Github repositories", headings)
end

Instance Method Details

#format(results) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/veye/views/github/list_table.rb', line 12

def format(results)
  results['repos'].each_with_index do |result, index|
    row = [(index + 1)]
    row << result['fullname']
    row << result['language']
    row << result['owner_login']
    row << result['owner_type']
    row << result['private']
    row << result['fork']
    row << result['branches'].to_a.join("\n")
    row << result['imported_projects'].to_a.join("\n")
    #row << result['description']
    @table << row
  end
end