Class: FbGraphApi::Client
- Inherits:
-
Object
- Object
- FbGraphApi::Client
- Defined in:
- lib/fb_graph_api/client.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(token) ⇒ Client
Returns a new instance of Client.
5 6 7 8 |
# File 'lib/fb_graph_api/client.rb', line 5 def initialize(token) @address = 'https://graph.facebook.com' @acess_token = token end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/fb_graph_api/client.rb', line 3 def token @token end |
Instance Method Details
#connection ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/fb_graph_api/client.rb', line 10 def connection Faraday.new(url: @address) do |conn| conn. 'Bearer', @acess_token conn.request :json conn.response :json, :content_type => /\bjson$/ conn.adapter Faraday.default_adapter end end |