Class: DeviseFacebookOpenGraph::Facebook::Session
- Inherits:
-
Object
- Object
- DeviseFacebookOpenGraph::Facebook::Session
- Defined in:
- lib/devise_facebook_open_graph/facebook/session.rb
Constant Summary collapse
- FACEBOOK_SESSION_KEYS =
Keys found in cookie content. We are supplying reader methods for these values which are read from cookie content
%w(session_key expires uid sig secret access_token)
Class Method Summary collapse
Instance Method Summary collapse
-
#cookie_content ⇒ Object
Returns facebook’s cookie content.
-
#graph ⇒ Object
Gives access to query as user with an oauth access token fetched from the cookie content.
-
#initialize(cookies) ⇒ Session
constructor
Creates a new Facebook session based cookies hash from a request.
-
#valid? ⇒ Boolean
Is this a valid session? True if we were able to parse facebook’s cookie content.
Constructor Details
#initialize(cookies) ⇒ Session
Creates a new Facebook session based cookies hash from a request
22 23 24 |
# File 'lib/devise_facebook_open_graph/facebook/session.rb', line 22 def initialize() @cookies = end |
Class Method Details
.new_or_nil_if_invalid(cookies) ⇒ Object
14 15 16 17 |
# File 'lib/devise_facebook_open_graph/facebook/session.rb', line 14 def self.new_or_nil_if_invalid() session = new() return session if session.valid? end |
Instance Method Details
#cookie_content ⇒ Object
Returns facebook’s cookie content
29 30 31 |
# File 'lib/devise_facebook_open_graph/facebook/session.rb', line 29 def @cookie_content ||= end |
#graph ⇒ Object
Gives access to query as user with an oauth access token fetched from the cookie content
36 37 38 |
# File 'lib/devise_facebook_open_graph/facebook/session.rb', line 36 def graph Koala::Facebook::GraphAPI.new(access_token) end |
#valid? ⇒ Boolean
Is this a valid session? True if we were able to parse facebook’s cookie content
53 54 55 |
# File 'lib/devise_facebook_open_graph/facebook/session.rb', line 53 def valid? !! end |