Sha256: 6660aeb2e62cbfdf0df7dfe8459d7991609919a956a6305262b9110f6697122d
Contents?: true
Size: 876 Bytes
Versions: 1
Compression:
Stored size: 876 Bytes
Contents
require 'oauth2' module OnlinegamesInfoConnect class OgiOauth include Singleton # Include Additional classes include OauthUsers include OauthMedals include OauthPremium include OauthGuild include OauthMessages include OauthFriends def get_client site = OGI_SETTINGS[:site].gsub('MARKET', I18n.locale.to_s) @client ||= OAuth2::Client.new(OGI_SETTINGS[:key], OGI_SETTINGS[:secret], :site => site) end def authorize(callback) get_client.auth_code.authorize_url(:redirect_uri => get_redirect_url(callback)) end def get_token(auth_code, callback) return get_client.auth_code.get_token(auth_code, :redirect_uri => get_redirect_url(callback)) end private def get_redirect_url(callback) return OGI_SETTINGS[:redirect_url].gsub('MARKET', I18n.locale.to_s) unless OGI_SETTINGS[:redirect_url].nil? return callback end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
onlinegames_info_connect-0.0.1 | lib/onlinegames_info_connect/ogi_oauth.rb |