Method: Lamed::MySQL#initialize
- Defined in:
- lib/lamed/model.rb
#initialize(params = {}) ⇒ MySQL
Returns a new instance of MySQL.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/lamed/model.rb', line 42 def initialize(params = {}) @params = params @host = params[:host] || '127.0.0.1' @port = (params[:port] || 3306).to_i @user = params[:username] || 'root' @password = params[:password] || 'pwd' @database = params[:database] @read_host = params[:read_host] @read_username = params[:read_user] @read_password = params[:read_password] @read_database = params[:read_password] @read_port = params[:read_port] self.connect end |