Class: MiniFB::OAuthSession

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_fb.rb

Overview

Manages access_token and locale params for an OAuth connection

Instance Method Summary collapse

Constructor Details

#initialize(access_token, locale = "en_US") ⇒ OAuthSession

Returns a new instance of OAuthSession.



322
323
324
325
# File 'lib/mini_fb.rb', line 322

def initialize(access_token, locale="en_US")
    @access_token = access_token
    @locale = locale
end

Instance Method Details

#fql(fql_query, options = {}) ⇒ Object



335
336
337
# File 'lib/mini_fb.rb', line 335

def fql(fql_query, options={})
    MiniFB.fql(@access_token, fql_query, session_options(options))
end

#get(id, options = {}) ⇒ Object



327
328
329
# File 'lib/mini_fb.rb', line 327

def get(id, options={})
    MiniFB.get(@access_token, id, session_options(options))
end

#graph_object(id) ⇒ Object

Returns a GraphObject for the given id



348
349
350
# File 'lib/mini_fb.rb', line 348

def graph_object(id)
    MiniFB::GraphObject.new(self, id)
end

#meObject

Returns and caches a GraphObject for the user



353
354
355
# File 'lib/mini_fb.rb', line 353

def me
    @me ||= graph_object('me')
end

#multifql(fql_queries, options = {}) ⇒ Object



339
340
341
# File 'lib/mini_fb.rb', line 339

def multifql(fql_queries, options={})
    MiniFB.multifql(@access_token, fql_queries, session_options(options))
end

#post(id, options = {}) ⇒ Object



331
332
333
# File 'lib/mini_fb.rb', line 331

def post(id, options={})
    MiniFB.post(@access_token, id, session_options(options))
end

#rest(api_method, options = {}) ⇒ Object



343
344
345
# File 'lib/mini_fb.rb', line 343

def rest(api_method, options={})
    MiniFB.rest(@access_token, api_method, session_options(options))
end