Module: Devise::Oauth2ProvidableFacebook

Defined in:
lib/oauth2_facebook_grantable.rb

Defined Under Namespace

Classes: Engine, Railties

Class Method Summary collapse

Class Method Details

.debugging=(boolean) ⇒ Object



20
21
22
# File 'lib/oauth2_facebook_grantable.rb', line 20

def self.debugging=(boolean)
  @@debugging = boolean
end

.debugging?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/oauth2_facebook_grantable.rb', line 17

def self.debugging?
  @@debugging
end

.facebook_user_for_token(token) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/oauth2_facebook_grantable.rb', line 24

def self.facebook_user_for_token(token)
  begin
    @@logger.error("Oauth2FacebookGrantable => Getting information from user token: #{token}")
    @graph = Koala::Facebook::API.new(token)
    return @graph.get_object("me")
  rescue => e
    @@logger.error("Oauth2FacebookGrantable => Could not authenticate with token: #{e}")
    return false
  end

end

.loggerObject



11
12
13
# File 'lib/oauth2_facebook_grantable.rb', line 11

def self.logger
  @@logger
end

.logger=(logger) ⇒ Object



14
15
16
# File 'lib/oauth2_facebook_grantable.rb', line 14

def self.logger=(logger)
  @@logger = logger
end