mini_fb 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mini_fb.rb +10 -4
  2. metadata +1 -1
data/lib/mini_fb.rb CHANGED
@@ -197,10 +197,16 @@ module MiniFB
197
197
  return false
198
198
  end
199
199
 
200
- def self.login_url(api_key, go_next=nil)
201
- login_url = "http://api.facebook.com/login.php"
202
- next_param = go_next.blank? ? "" : "&next=#{go_next}"
203
- return "#{login_url}?api_key=#{api_key}#{next_param}"
200
+ # Returns the login/add app url for your application.
201
+ #
202
+ # options:
203
+ # - :next => a relative next page to go to. relative to your facebook connect url or if :canvas is true, then relative to facebook app url
204
+ # - :canvas => true/false - to say whether this is a canvas app or not
205
+ def self.login_url(api_key, options={})
206
+ login_url = "http://api.facebook.com/login.php?api_key=#{api_key}"
207
+ login_url << "&next=#{options[:next]}" if options[:next]
208
+ login_url << "&canvas" if options[:canvas]
209
+ login_url
204
210
  end
205
211
 
206
212
  # This function expects arguments as a hash, so
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_fb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder