Topic: Access session variables from a plugin
Could anyone tell me how I can access session variables from a plugin that I am writing. The way I want this to work is that when I call a method in the plugin I can specify an argument, but if I don't specify an argument, it gets the argument from the session hash.
Let's say I have a program that models a house, and plugin that has cleaning functions. As I move around the house I keep track of my location as a session variable. If I want to clean the room I'm in, I just have to run the command clean_room, but if I want to clean a different room, I specify the room id like clean_room(4). I would envision the function to look something like this:
#this function is in a file in the plugin's 'lib' directory
def clean_room(room_id = session[:room])
Unfortunately "session" doesn't work. Is there something I can mix into my plugin that will give me access to the session hash?