Last active
February 27, 2019 18:11
-
-
Save mergulhao/757c3bf86399acce81f91c823fdf69c9 to your computer and use it in GitHub Desktop.
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
class Linkedin | |
include HTTParty | |
base_uri 'https://api.linkedin.com/v2' | |
def initialize(token) | |
@token = token | |
end | |
def me | |
self.class.get('/me', options) | |
end | |
private | |
def options | |
@options ||= { headers: { "Authorization": "Bearer #{@token}" } } | |
end | |
end | |
l = Linkedin.new("my-token") | |
l.me["id"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment