Ruby: Database Authentication Module
What is the use case and rationale for this module? I can see what it does, but I'm struggling to understand why I'd want to do it.
The fact that you have three almost identical case statements to drive the behaviour is a 'code smell'. In most other OO languages you'd use inheritance or an interface and a factory method to determine which subclass of an object to create (with a single case statement). In that case, the objective is to abstract away the differences between connecting to the databases behind an interface (which is what you seem to be trying to do in method database_authentication_success?). But the metaprogramming code generates explicitly-named methods for connecting to each type of database, which seems to do the opposite and makes it harder to use.