Skip to content

Instantly share code, notes, and snippets.

View simplyb's full-sized avatar

Pete Broderick simplyb

View GitHub Profile
@simplyb
simplyb / gist:7550368
Last active December 28, 2015 19:29 — forked from cupakromer/gist:7550244
# The idea here is that if any of the three tokens are not already
# set, then they should be generated. In order to generate one, it
# must be unique.
def generate_tokens!
[ :code, :access_token, :refresh_token ].each do |attr|
next if send(attr)
send "#{attr}=", tokenize(attr)
end
end