Last active
August 29, 2015 14:09
-
-
Save zackshapiro/206826141d4d11b4c5af to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# /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