Class: FacebookClient::Base
- Inherits:
-
Object
- Object
- FacebookClient::Base
- Defined in:
- lib/facebook_client.rb
Constant Summary collapse
- GRAPH_URL =
'https://graph.facebook.com'
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #auth ⇒ Object
- #graph(token, expires = nil) ⇒ Object
-
#initialize(default_params = {}) ⇒ Base
constructor
A new instance of Base.
- #method_missing(name, *args) ⇒ Object
- #rest_api ⇒ Object
Constructor Details
#initialize(default_params = {}) ⇒ Base
Returns a new instance of Base.
22 23 24 25 26 27 28 29 30 |
# File 'lib/facebook_client.rb', line 22 def initialize(default_params={}) @params = default_params.reverse_merge({ :app_id => ENV['FB_APP_ID'], :api_key => ENV['FB_API_KEY'], :secret => ENV['FB_SECRET'], :canvas => ENV['FB_CANVAS'], :callback_url => ENV['FB_CALLBACK_URL'] }) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/facebook_client.rb', line 44 def method_missing(name, *args) if @params.has_key?(name) return @params[name] else super end end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
20 21 22 |
# File 'lib/facebook_client.rb', line 20 def params @params end |