Class: Mysqlknife::Parameters

Inherits:
Object
  • Object
show all
Defined in:
lib/mysqlknife/parameters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParameters

Returns a new instance of Parameters.



8
9
10
# File 'lib/mysqlknife/parameters.rb', line 8

def initialize
  @cnf = Configs.instance
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



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

def command
  @command
end

#connection=(value) ⇒ Object (writeonly)

Sets the attribute connection

Parameters:

  • value

    the value to set the attribute connection to.



5
6
7
# File 'lib/mysqlknife/parameters.rb', line 5

def connection=(value)
  @connection = value
end

#databaseObject

Returns the value of attribute database.



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

def database
  @database
end

#tool=(value) ⇒ Object (writeonly)

Sets the attribute tool

Parameters:

  • value

    the value to set the attribute tool to.



5
6
7
# File 'lib/mysqlknife/parameters.rb', line 5

def tool=(value)
  @tool = value
end

Instance Method Details

#connection_detailsObject



18
19
20
21
22
# File 'lib/mysqlknife/parameters.rb', line 18

def connection_details
  unless @connection.nil?
    puts @cnf.show(@connection)
  end
end

#connectionsObject



12
13
14
15
16
# File 'lib/mysqlknife/parameters.rb', line 12

def connections
  if @connection.nil?
    puts @cnf.connections
  end
end

#toolsObject



24
25
26
27
28
29
# File 'lib/mysqlknife/parameters.rb', line 24

def tools
  if @connection.nil? == false &&
     @tool.nil?       == true
    puts @cnf.tools(@connection)
  end
end