Class: Veye::Package::SearchCSV
- Defined in:
- lib/veye/views/package/search_csv.rb
Instance Method Summary collapse
- #format(results) ⇒ Object
-
#initialize ⇒ SearchCSV
constructor
A new instance of SearchCSV.
Methods inherited from BaseCSV
Constructor Details
#initialize ⇒ SearchCSV
Returns a new instance of SearchCSV.
6 7 8 9 |
# File 'lib/veye/views/package/search_csv.rb', line 6 def initialize headers = "nr,name,version,prod_key,language,group_id" super(headers) end |
Instance Method Details
#format(results) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/veye/views/package/search_csv.rb', line 11 def format(results) items = results['results'] return if items.nil? items.each_with_index do |result, index| printf("%d,%s,%s,%s,%s,%s\n", index + 1, result["name"], result["version"], result["prod_key"], result["language"], result["group_id"]) end end |