Class: OAuth::Facebook
Constant Summary collapse
- HOST =
'https://graph.facebook.com'
- ACCESS_TOKEN_URL =
HOST + '/oauth/access_token'
- DATA_URL =
HOST + '/me?fields=id,email,name,birthday,location,gender,picture'
- FRIENDS_URL =
HOST + '/me/friends'
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from OAuth::Base
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
9 10 11 |
# File 'app/models/o_auth/facebook.rb', line 9 def access_token @access_token end |
Instance Method Details
#get_access_token ⇒ Object
11 12 13 14 15 |
# File 'app/models/o_auth/facebook.rb', line 11 def get_access_token response = @client.get(ACCESS_TOKEN_URL, @params) Rack::Utils.parse_query(response.body)['access_token'] end |
#get_names ⇒ Object
17 18 19 |
# File 'app/models/o_auth/facebook.rb', line 17 def get_names [data[:first_name], data[:last_name]] end |