Class: Veye::Github::SearchTable
- Defined in:
- lib/veye/views/github/search_table.rb
Instance Method Summary collapse
- #format(results) ⇒ Object
-
#initialize ⇒ SearchTable
constructor
A new instance of SearchTable.
- #print_row(result, index) ⇒ Object
Methods inherited from BaseTable
Constructor Details
#initialize ⇒ SearchTable
Returns a new instance of SearchTable.
6 7 8 9 |
# File 'lib/veye/views/github/search_table.rb', line 6 def initialize headings = %w(index name language owner_name owner_type private fork watchers forks github_url) super("Search results", headings) end |
Instance Method Details
#format(results) ⇒ Object
11 12 13 14 15 |
# File 'lib/veye/views/github/search_table.rb', line 11 def format(results) results['results'].each_with_index do |result, index| print_row(result, index) end end |
#print_row(result, index) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/veye/views/github/search_table.rb', line 17 def print_row(result, index) row = [(index + 1)] row << result['name'] row << result['language'] row << result['owner_name'] row << result['owner_type'] row << result['private'] row << result['fork'] row << result['watchers'] row << result['forks'] row << result['git_url'] @table << row end |