Skip to content

Instantly share code, notes, and snippets.

Created September 29, 2015 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/acdd9af77c53de966673 to your computer and use it in GitHub Desktop.
Save anonymous/acdd9af77c53de966673 to your computer and use it in GitHub Desktop.
def set_connecttion(options)
if check_key(options, :connect)
connect = options[:connect]
if check_key_string(connect, :file)
@connection = YAML.load(File.read connect[:file])
end
@connection[:url] = connect[:url] if check_key_string(connect, :url)
@connection[:user] = connect[:user] if check_key_string(connect, :user)
@connection[:password] = connect[:password] \
if check_key_string(connect, :password)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment