Sha256: aae5bbc804b130779d57aa2a84d02baf713ab8773b5a1d70ac17d34eb2ba0e17

Contents?: true

Size: 839 Bytes

Versions: 2

Compression:

Stored size: 839 Bytes

Contents

module FBGraph
  
  class Client
      attr_accessor :client_id , :secret_id , :facebook_uri , :access_token , :consumer 
      
    
      def initialize(options)
        self.client_id , self.secret_id = options[:client_id] , options[:secret_id]
        @facebook_uri = 'https://graph.facebook.com'
        if self.access_token = options[:token]
          self.consumer = OAuth2::AccessToken.new(oauth_client , self.access_token)
        end
        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 oauth_client
        OAuth2::Client.new(client_id, secret_id, :site => facebook_uri)
      end
      
  end  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fbgraph-0.0.4 lib/fbgraph/client.rb
fbgraph-0.0.2 lib/fbgraph/client.rb