Class: FacebookOAuth::FacebookObject

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

Instance Method Summary collapse

Constructor Details

#initialize(oid, client) ⇒ FacebookObject

Returns a new instance of FacebookObject.



55
56
57
58
# File 'lib/facebook_oauth/objects.rb', line 55

def initialize(oid, client)
  @oid = oid
  @client = client
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



64
65
66
67
68
69
70
71
72
73
# File 'lib/facebook_oauth/objects.rb', line 64

def method_missing(method, *args)
  first = args.shift
  params = args.first || {}
  
  if first and first == :create
    @client.send(:_post, "/#{@oid}/#{method.to_s}", params)
  else
    @client.send(:_get, "/#{@oid}/#{method.to_s}")
  end
end

Instance Method Details

#infoObject



60
61
62
# File 'lib/facebook_oauth/objects.rb', line 60

def info
  @client.send(:_get, @oid)
end