Class: Fb::Auth
- Inherits:
-
Object
- Object
- Fb::Auth
- Defined in:
- lib/fb/auth.rb,
lib/fb/auth/version.rb
Overview
Provides methods to authenticate a user with the Facebook OAuth flow.
Constant Summary collapse
- VERSION =
Returns the SemVer-compatible gem version.
"0.1.2"
Instance Method Summary collapse
-
#access_token ⇒ String
The non-expiring access token of an authenticated Facebook account.
-
#initialize(options = {}) ⇒ Auth
constructor
A new instance of Auth.
-
#url ⇒ String
A url to Facebook’s account authentication.
Constructor Details
#initialize(options = {}) ⇒ Auth
Returns a new instance of Auth.
14 15 16 17 |
# File 'lib/fb/auth.rb', line 14 def initialize( = {}) @redirect_uri = [:redirect_uri] @code = [:code] end |
Instance Method Details
#access_token ⇒ String
Returns the non-expiring access token of an authenticated Facebook account.
25 26 27 28 29 |
# File 'lib/fb/auth.rb', line 25 def access_token response_body = Fb::Request.new(path: '/oauth/access_token', params: long_term_token_params).run response_body["access_token"] end |
#url ⇒ String
Returns a url to Facebook’s account authentication.
20 21 22 |
# File 'lib/fb/auth.rb', line 20 def url Fb::Request.new().url end |