Class: Veye::Github::SearchCSV
- Defined in:
- lib/veye/views/github/search_csv.rb
Instance Method Summary collapse
- #format(results) ⇒ Object
-
#initialize ⇒ SearchCSV
constructor
A new instance of SearchCSV.
- #print_row(result, index) ⇒ Object
Methods inherited from BaseCSV
Constructor Details
#initialize ⇒ SearchCSV
Returns a new instance of SearchCSV.
6 7 8 9 |
# File 'lib/veye/views/github/search_csv.rb', line 6 def initialize columns = %w[nr,name,language,owner_name,owner_type,private,fork,watchers,forks,git_url] super(columns) end |
Instance Method Details
#format(results) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/veye/views/github/search_csv.rb', line 11 def format(results) return if results.nil? results['results'].each_with_index do |result, index| print_row(result, index) end end |
#print_row(result, index) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/veye/views/github/search_csv.rb', line 19 def print_row(result, index) printf("%d,%s,%s,%s,%s,%s,%s,%s,%s,%s\n", index + 1, result['name'], result['language'], result['owner_name'], result['owner_type'], result['private'], result['fork'], result['watchers'], result['forks'], result['git_url'] ) end |