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.
19 20 21 22 23 24 25 26 27 |
# File 'lib/facebook_client.rb', line 19 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
41 42 43 44 45 46 47 |
# File 'lib/facebook_client.rb', line 41 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.
17 18 19 |
# File 'lib/facebook_client.rb', line 17 def params @params end |