Class: Veye::Project::LicenceCSV
- Defined in:
- lib/veye/views/project/licence_csv.rb
Instance Method Summary collapse
- #format(results) ⇒ Object
-
#initialize ⇒ LicenceCSV
constructor
A new instance of LicenceCSV.
Methods inherited from BaseCSV
Constructor Details
#initialize ⇒ LicenceCSV
Returns a new instance of LicenceCSV.
6 7 8 9 |
# File 'lib/veye/views/project/licence_csv.rb', line 6 def initialize headers = "nr,license,product_keys" super(headers) end |
Instance Method Details
#format(results) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/veye/views/project/licence_csv.rb', line 10 def format(results) return nil if results.nil? n = 1 results["licenses"].each_pair do |license, prods| prod_keys = prods.map {|p| p["prod_key"]} printf("%d,%s,%s\n", n, license, prod_keys.join(',')) n += 1 end end |