Class: Oauthio::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/oauthio/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_tokenObject

Returns the value of attribute access_token.



5
6
7
# File 'lib/oauthio/client.rb', line 5

def access_token
  @access_token
end

#providerObject

Returns the value of attribute provider.



5
6
7
# File 'lib/oauthio/client.rb', line 5

def provider
  @provider
end

Instance Method Details

#meObject



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