Module: Metrika::Helpers::Authorization
- Included in:
- Metrika::Helpers
- Defined in:
- lib/metrika/helpers/authorization.rb
Constant Summary collapse
- DEFAULT_OAUTH_OPTIONS =
{ :site => 'http://api-metrika.yandex.ru', :authorize_url => 'https://oauth.yandex.ru/authorize', :token_url => 'https://oauth.yandex.ru/token' }
Instance Method Summary collapse
- #authorization_url ⇒ Object
- #authorize_token(auth_code) ⇒ Object
- #restore_token(access_token) ⇒ Object
Instance Method Details
#authorization_url ⇒ Object
14 15 16 |
# File 'lib/metrika/helpers/authorization.rb', line 14 def self.client.auth_code. end |
#authorize_token(auth_code) ⇒ Object
10 11 12 |
# File 'lib/metrika/helpers/authorization.rb', line 10 def (auth_code) @token = (self.client.auth_code.get_token(auth_code) rescue nil) end |
#restore_token(access_token) ⇒ Object
18 19 20 |
# File 'lib/metrika/helpers/authorization.rb', line 18 def restore_token(access_token) @token = OAuth2::AccessToken.new(self.client, access_token) end |