Class: Veye::Project::InfoTable

Inherits:
BaseTable show all
Defined in:
lib/veye/views/project/info_table.rb

Instance Method Summary collapse

Methods inherited from BaseTable

#after, #before

Constructor Details

#initializeInfoTable

Returns a new instance of InfoTable.



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

def initialize
  headings = %w(index name project_key private period source dependencies outdated created_at)
  super("List of projects", headings)
end

Instance Method Details

#format(results) ⇒ Object



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

def format(results)
  return if results.nil?
  results = [results] if results.is_a? Hash

  results.each_with_index do |result, index|
    row = [index + 1, result['name'], result['project_key'],
           result['private'], result['period'], result['source'],
           result['dep_number'], result['out_number'], result['created_at']]
    @table << row
   end
end