Method: Arql::Commands::Models.models_table

Defined in:
lib/arql/commands/models.rb

.models_table(regexp) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/arql/commands/models.rb', line 16

def models_table(regexp)
  Terminal::Table.new do |t|
    models.each_with_index { |row, idx| t << (row || :separator) if row.nil? ||
      regexp.nil? ||
      idx.zero? ||
      row.any? { |e| e =~ regexp }
    }
  end
end