class OmniAuth::Strategies::Weasyl
Public Class Methods
new(app, consumer_key = nil, consumer_secret = nil, options = {}, &block)
click to toggle source
Calls superclass method
# File lib/omniauth/strategies/weasyl.rb, line 7 def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) site = options[:site] || 'https://www.weasyl.com' opts = { :client_options => { :site => site, :authorize_url => site + '/api/oauth2/authorize', :token_url => site + '/api/oauth2/token', }, } super(app, consumer_key, consumer_secret, opts, &block) end
Public Instance Methods
access_token()
click to toggle source
# File lib/omniauth/strategies/weasyl.rb, line 42 def access_token ::OAuth2::AccessToken.new(client, oauth2_access_token.token, { :mode => :header, :param_name => 'oauth2_access_token', :expires_in => oauth2_access_token.expires_in, :expires_at => oauth2_access_token.expires_at, }) end
Also aliased as: oauth2_access_token
auth_hash()
click to toggle source
Calls superclass method
# File lib/omniauth/strategies/weasyl.rb, line 34 def auth_hash h = super h.username = raw_info['login'] h end
raw_info()
click to toggle source
# File lib/omniauth/strategies/weasyl.rb, line 51 def raw_info @raw_info ||= MultiJson.load access_token.get('/api/whoami').body end