Sha256: 41c22675d5dfc1e9f344f33cae198edce95b01432cd045d1c93cc63502dab691

Contents?: true

Size: 641 Bytes

Versions: 8

Compression:

Stored size: 641 Bytes

Contents

require 'terminal-table'

module Arql::Commands
  module Models
    class << self
      def models
        Terminal::Table.new do |t|
          t << ['Table Name', 'Model Class', 'Abbr']
          t << :separator
          Arql::Definition.models.each do |definition|
            t << [definition[:table], definition[:model].name, definition[:abbr] || '']
          end
        end
      end

    end

    Pry.commands.block_command 'models' do
      puts
      puts Models::models
    end

    Pry.commands.alias_command 'm', 'models'
    Pry.commands.alias_command 'l', 'models'
    Pry.commands.alias_command 'tables', 'models'
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
arql-0.1.10 lib/arql/commands/models.rb
arql-0.1.9 lib/arql/commands/models.rb
arql-0.1.8 lib/arql/commands/models.rb
arql-0.1.7 lib/arql/commands/models.rb
arql-0.1.6 lib/arql/commands/models.rb
arql-0.1.5 lib/arql/commands/models.rb
arql-0.1.4 lib/arql/commands/models.rb
arql-0.1.3 lib/arql/commands/models.rb