Class: Mysqlknife::Parameter::Describe

Inherits:
Base
  • Object
show all
Defined in:
lib/mysqlknife/parameter/describe.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#connection, #host

Instance Method Summary collapse

Methods inherited from Base

#connections, #hosts, #initialize

Constructor Details

This class inherits a constructor from Mysqlknife::Parameter::Base

Instance Attribute Details

#database=(value) ⇒ Object (writeonly)

Sets the attribute database

Parameters:

  • value

    the value to set the attribute database to.



6
7
8
# File 'lib/mysqlknife/parameter/describe.rb', line 6

def database=(value)
  @database = value
end

#table=(value) ⇒ Object (writeonly)

Sets the attribute table

Parameters:

  • value

    the value to set the attribute table to.



6
7
8
# File 'lib/mysqlknife/parameter/describe.rb', line 6

def table=(value)
  @table = value
end

Instance Method Details

#connectObject



8
9
10
11
12
13
14
15
# File 'lib/mysqlknife/parameter/describe.rb', line 8

def connect
  @config.connection(@connection)
  if @connection.nil? == false &&
     @host.nil?       == false
    puts "Connecting to: #{@config.select(@host)}"
    @command.execute(@mysql.describe(@database, @table))
  end
end