Sha256: fd136316ccaf9ebf98a9d31193189f83430d0fec285243b3d2243fa25c6367e2

Contents?: true

Size: 936 Bytes

Versions: 3

Compression:

Stored size: 936 Bytes

Contents

module FBGraph
  
  class Client

    attr_accessor :client_id , :secret_id , :facebook_uri , :access_token , :consumer , :auth
      
    def initialize(options = {})
      @client_id, @secret_id = options[:client_id] || FBGraph.config[:client_id], options[:secret_id] || FBGraph.config[:secret_id]
      @facebook_uri = 'https://graph.facebook.com'
      @consumer = RestClient::Resource.new(@facebook_uri)
      @access_token = options.fetch :token, nil
      @auth = OAuth2::AccessToken.new(oauth_client , @access_token)
      return true
    end
    
    def authorization
      FBGraph::Authorization.new(self)
    end
    
    def selection
      FBGraph::Selection.new(self)
    end
    
    def search
      FBGraph::Search.new(self)
    end
    
    def realtime
      FBGraph::Realtime.new(self)
    end
    
    def oauth_client
      OAuth2::Client.new(client_id, secret_id, :site => facebook_uri)
    end
    
  end  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fbgraph-0.1.6.4.1 lib/fbgraph/client.rb
fbgraph-0.1.6.4 lib/fbgraph/client.rb
fbgraph-0.1.6.3 lib/fbgraph/client.rb