I’m relatively new to Ruby, and definitely to Modules. I’m working on
some database query tools, and wanted to break out database connections
and disconnects in separate methods for re-use elsewhere.
Unfortunately, when I use a method which connects to the database and
later use a method to disconnect it sees the variables as undefined
This is just a very simple example to outline what I’m hoping to do. If
anyone has any ideas, please let me know. I’m likely way off base, but I
can’t seem to find any information on what I’m trying to do.
Method to connect to the Database
@@dbh = DBI.connect(‘DBI:OCI8:NAME’, ‘name’, ‘pw’)
Method to close the Database connection