I'm using Sinatra to handle authentication on a remote server and do a few other simple things. Basically the user authenticates through a page displayed on localhost. After a few exchanges between localhost and the remote server, an object is created that I want to use later. From the moment my object is constructed, no longer need the local Sinatra server.
My Sinatra app is in the form of a class that inherits Sinatra::Base
.
What I'd like to do is something like:
# server runs until the user has reached a certain page
# and then returns my business object
object = MySinatraClass.run!
# do stuff with object
Is this possible? If not, I could also settle for a solution where I pass a block or function to MySinatraClass.run!
that I would execute at the right moment.