Module: FacebookGraphr::Rails::Controller

Defined in:
lib/facebook_graphr/controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(controller) ⇒ Object



4
5
6
# File 'lib/facebook_graphr/controller.rb', line 4

def self.included(controller)
  controller.helper_method :facebook_graph_session
end

Instance Method Details

#facebook_graph_sessionObject



8
9
10
11
12
13
# File 'lib/facebook_graphr/controller.rb', line 8

def facebook_graph_session
  @facebook_graph_session ||= begin
    cookie = cookies["fbs_#{FacebookGraphr.config[:app_id]}"]
    FacebookGraphr::Session.new_from_cookie(cookie) if cookie
  end
end