Slide 54
Slide 54 text
接続要求
def initialize(opts = {})
raise Mysql2::Error, "Options parameter must be a Hash" unless opts.is_a? Hash
opts = Mysql2::Util.key_hash_as_symbols(opts)
...
user = opts[:username] || opts[:user]
pass = opts[:password] || opts[:pass]
host = opts[:host] || opts[:hostname]
port = opts[:port]
database = opts[:database] || opts[:dbname] || opts[:db]
socket = opts[:socket] || opts[:sock]
conn_attrs = parse_connect_attrs(opts[:connect_attrs])
...
connect user, pass, host, port, database, socket, flags, conn_attrs
end
mysq2/client.rb