Class: Veye::Project::LicenceTable

Inherits:
BaseTable
  • Object
show all
Defined in:
lib/veye/views/project/licence_table.rb

Instance Method Summary collapse

Methods inherited from BaseTable

#after, #before

Constructor Details

#initializeLicenceTable

Returns a new instance of LicenceTable.



6
7
8
9
# File 'lib/veye/views/project/licence_table.rb', line 6

def initialize
  headings = %w(index license product_keys)
  super("Licences", headings)
end

Instance Method Details

#format(results) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/veye/views/project/licence_table.rb', line 10

def format(results)
  items = results['licenses']
  return if items.nil?
  n = 1
  items.each_pair do |license, products|
    products.each do |prod|
      row = [n, license, prod["prod_key"]]
      @table << row
    end
    n += 1
  end
end