Skip to content

Instantly share code, notes, and snippets.

@zackshapiro
Last active August 29, 2015 14:09
Show Gist options
  • Save zackshapiro/206826141d4d11b4c5af to your computer and use it in GitHub Desktop.
Save zackshapiro/206826141d4d11b4c5af to your computer and use it in GitHub Desktop.
# /app/models/user.rb
# because this code is in user.rb, the user is implied
# because you're in the user model, you can call methods on user without `user.`
# so user.access_token becomes access_token
# contact me [email protected] with questions
def create_client
@tokens = {
access_token: access_token,
refresh_token: refresh_token,
expires_at: Time.now + 2.hours
}
client = Coinbase::OAuthClient.new(ENV['COINBASE_CLIENT_ID'], ENV['COINBASE_CLIENT_SECRET'], @tokens)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment