Class: Metova::Oauth::FluxProvider
Constant Summary
collapse
- FLUX_API_URL =
'https://id.fluxhq.io/api/v1'
- ME_URL =
-> (token) { "#{FLUX_API_URL}/me?access_token=#{token}" }
Instance Attribute Summary
#access_token, #info, #token_secret, #uid
Instance Method Summary
collapse
authenticate, #initialize
Instance Method Details
#authenticate ⇒ Object
7
8
9
10
11
|
# File 'lib/metova/oauth/flux_provider.rb', line 7
def authenticate
self.info = OmniAuth::AuthHash.new me
self.uid = info.id
self
end
|
#me ⇒ Object
21
22
23
24
25
|
# File 'lib/metova/oauth/flux_provider.rb', line 21
def me
super do
JSON.parse URI.parse(ME_URL[access_token]).read
end
end
|
#name ⇒ Object
13
14
15
|
# File 'lib/metova/oauth/flux_provider.rb', line 13
def name
'FluxID'
end
|
#provider ⇒ Object
17
18
19
|
# File 'lib/metova/oauth/flux_provider.rb', line 17
def provider
:flux
end
|