Class: Oauthio::Client
- Inherits:
-
Object
- Object
- Oauthio::Client
- Defined in:
- lib/oauthio/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#provider ⇒ Object
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(provider, access_token) ⇒ Client
constructor
A new instance of Client.
- #me ⇒ Object
Constructor Details
#initialize(provider, access_token) ⇒ Client
Returns a new instance of Client.
7 8 9 10 |
# File 'lib/oauthio/client.rb', line 7 def initialize provider, access_token @provider = provider @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/oauthio/client.rb', line 5 def access_token @access_token end |
#provider ⇒ Object
Returns the value of attribute provider.
5 6 7 |
# File 'lib/oauthio/client.rb', line 5 def provider @provider end |
Instance Method Details
#me ⇒ Object
12 13 14 15 16 17 |
# File 'lib/oauthio/client.rb', line 12 def me HTTParty.get "#{Oauthio.endpoint_url}/#{@provider}/me", headers: { 'oauthio' => "k=#{Oauthio.public_key}&access_token=#{@access_token}", 'Content-Type' => 'application/json' } end |