Class: Strobe::Addons::Social::Facebook
- Inherits:
-
Object
- Object
- Strobe::Addons::Social::Facebook
- Defined in:
- lib/strobe/addons/social/facebook.rb
Defined Under Namespace
Classes: NotFoundError
Constant Summary collapse
- COOKIE_KEY =
"facebook_access_token"
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(settings) ⇒ Facebook
constructor
A new instance of Facebook.
Constructor Details
#initialize(settings) ⇒ Facebook
Returns a new instance of Facebook.
13 14 15 |
# File 'lib/strobe/addons/social/facebook.rb', line 13 def initialize(settings) @settings = settings end |
Instance Method Details
#_call(env) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/strobe/addons/social/facebook.rb', line 23 def _call(env) @request = Rack::Request.new(env) @response = Rack::Response.new case @request.path_info when "/callback" callback when "/status" status else raise NotFoundError, "Not found" end @response.finish end |
#call(env) ⇒ Object
17 18 19 20 21 |
# File 'lib/strobe/addons/social/facebook.rb', line 17 def call(env) dup._call(env) rescue NotFoundError => error Rack::Response.new("#{error.}\n", error.code, "Content-Type" => "text/plain").finish end |