Created
March 14, 2010 18:49
-
-
Save juggy/332154 to your computer and use it in GitHub Desktop.
One way to use the bolide client api for ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bolide" | |
def load_bolide | |
# For use with rails: a client/q per session is created | |
@bolide = session[:bolide] | |
@q = session[:q] | |
if @bolide.nil? | |
# create a new session with Bolide | |
@bolide = Bolide::Account.new("bolide", "xxxx61d0-095c-012d-0076-404077aa86f5") | |
session[:bolide] = @bolide | |
end | |
if @q.nil? | |
# create or refresh the session q | |
@q = @bolide.get_q(session[:session_id]) | |
session[:q] = @q | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment