Class: FacebookOAuth::Client
- Inherits:
-
Object
- Object
- FacebookOAuth::Client
- Defined in:
- lib/facebook_oauth/client.rb,
lib/facebook_oauth/objects.rb
Instance Method Summary (collapse)
- - (Object) album(id)
- - (Object) authorize(options = {})
- - (Object) authorize_url(options = {})
- - (Object) event(id)
- - (Object) group(id)
-
- (Client) initialize(options = {})
constructor
A new instance of Client.
- - (Object) link(id)
- - (Object) me(id = 'me'))
- - (Object) note(id)
- - (Object) page(id)
- - (Object) photo(id)
- - (Object) post(id)
- - (Object) status(id)
- - (Object) user(id)
- - (Object) video(id)
Constructor Details
- (Client) initialize(options = {})
A new instance of Client
6 7 8 9 10 11 |
# File 'lib/facebook_oauth/client.rb', line 6 def initialize( = {}) @application_id = [:application_id] @application_secret = [:application_secret] @callback = [:callback] @token = [:token] end |
Instance Method Details
- (Object) album(id)
8 9 10 |
# File 'lib/facebook_oauth/objects.rb', line 8 def album(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) authorize(options = {})
21 22 23 24 25 26 27 28 |
# File 'lib/facebook_oauth/client.rb', line 21 def ( = {}) @access_token ||= consumer.web_server.get_access_token( [:code], :redirect_uri => [:callback] || @callback ) @token = @access_token.token @access_token end |
- (Object) authorize_url(options = {})
13 14 15 16 17 18 19 |
# File 'lib/facebook_oauth/client.rb', line 13 def ( = {}) [:scope] ||= 'offline_access,publish_stream' consumer.web_server.( :redirect_uri => [:callback] || @callback, :scope => [:scope] ) end |
- (Object) event(id)
12 13 14 |
# File 'lib/facebook_oauth/objects.rb', line 12 def event(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) group(id)
16 17 18 |
# File 'lib/facebook_oauth/objects.rb', line 16 def group(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) link(id)
20 21 22 |
# File 'lib/facebook_oauth/objects.rb', line 20 def link(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) me(id = 'me'))
4 5 6 |
# File 'lib/facebook_oauth/objects.rb', line 4 def me(id = 'me') FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) note(id)
24 25 26 |
# File 'lib/facebook_oauth/objects.rb', line 24 def note(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) page(id)
28 29 30 |
# File 'lib/facebook_oauth/objects.rb', line 28 def page(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) photo(id)
32 33 34 |
# File 'lib/facebook_oauth/objects.rb', line 32 def photo(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) post(id)
36 37 38 |
# File 'lib/facebook_oauth/objects.rb', line 36 def post(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) status(id)
40 41 42 |
# File 'lib/facebook_oauth/objects.rb', line 40 def status(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) user(id)
44 45 46 |
# File 'lib/facebook_oauth/objects.rb', line 44 def user(id) FacebookOAuth::FacebookObject.new(id, self) end |
- (Object) video(id)
48 49 50 |
# File 'lib/facebook_oauth/objects.rb', line 48 def video(id) FacebookOAuth::FacebookObject.new(id, self) end |