Skip to content

Instantly share code, notes, and snippets.

@juggy
Created March 14, 2010 18:49
Show Gist options
  • Save juggy/332154 to your computer and use it in GitHub Desktop.
Save juggy/332154 to your computer and use it in GitHub Desktop.
One way to use the bolide client api for ruby
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