Class: DBA::TableCommand

Inherits:
Command show all
Defined in:
lib/dba/table_command.rb

Direct Known Subclasses

Indexes, Schema

Instance Attribute Summary

Attributes inherited from Command

#database, #table_name

Instance Method Summary collapse

Methods inherited from Command

arity_check, #initialize

Constructor Details

This class inherits a constructor from DBA::Command

Instance Method Details

#call(table = nil) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/dba/table_command.rb', line 2

def call(table = nil)
  if table
    self.table_name = table

    visit(table_name)
  else
    database.tables.sort.each { |name| visit(name) }
  end
end