Class: MiniFB::OAuthSession
- Inherits:
-
Object
- Object
- MiniFB::OAuthSession
- Defined in:
- lib/mini_fb.rb
Overview
Manages access_token and locale params for an OAuth connection
Instance Method Summary collapse
- #fql(fql_query, options = {}) ⇒ Object
- #get(id, options = {}) ⇒ Object
-
#graph_object(id) ⇒ Object
Returns a GraphObject for the given id.
-
#initialize(access_token, locale = "en_US") ⇒ OAuthSession
constructor
A new instance of OAuthSession.
-
#me ⇒ Object
Returns and caches a GraphObject for the user.
- #multifql(fql_queries, options = {}) ⇒ Object
- #post(id, options = {}) ⇒ Object
- #rest(api_method, options = {}) ⇒ Object
Constructor Details
#initialize(access_token, locale = "en_US") ⇒ OAuthSession
Returns a new instance of OAuthSession.
417 418 419 420 |
# File 'lib/mini_fb.rb', line 417 def initialize(access_token, locale="en_US") @access_token = access_token @locale = locale end |
Instance Method Details
#fql(fql_query, options = {}) ⇒ Object
430 431 432 |
# File 'lib/mini_fb.rb', line 430 def fql(fql_query, ={}) MiniFB.fql(@access_token, fql_query, ()) end |
#get(id, options = {}) ⇒ Object
422 423 424 |
# File 'lib/mini_fb.rb', line 422 def get(id, ={}) MiniFB.get(@access_token, id, ()) end |
#graph_object(id) ⇒ Object
Returns a GraphObject for the given id
443 444 445 |
# File 'lib/mini_fb.rb', line 443 def graph_object(id) MiniFB::GraphObject.new(self, id) end |
#me ⇒ Object
Returns and caches a GraphObject for the user
448 449 450 |
# File 'lib/mini_fb.rb', line 448 def me @me ||= graph_object('me') end |
#multifql(fql_queries, options = {}) ⇒ Object
434 435 436 |
# File 'lib/mini_fb.rb', line 434 def multifql(fql_queries, ={}) MiniFB.multifql(@access_token, fql_queries, ()) end |