Skip to content

Commit

Permalink
changes per code-review
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed May 6, 2010
1 parent 5727d32 commit 792d4c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions lib/facebook-graphclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ module Facebook

class GraphClient

attr_reader :secret, :app_id
attr_reader :secret, :app_id, :api_key
attr_accessor :access_token

def initialize facebook_settings = {}
@app_id = facebook_settings[:app_id]
@api_key = facebook_settings[:api_key]
@secret = facebook_settings[:secret]

@cookie = get_user_cookie facebook_settings[:cookies]
Expand Down Expand Up @@ -50,10 +51,7 @@ def api action, method, query_params = nil
tries = 0
begin
raw_response = @session.send(action, GRAPH_URL + method + query_string)
rescue Patron::HostResolutionError
retry if tries < 5
tries += 1
rescue Patron::ConnectionFailed
rescue Patron::HostResolutionError, Patron::ConnectionFailed
retry if tries < 5
tries += 1
end
Expand Down Expand Up @@ -86,10 +84,7 @@ def fql query
tries = 0
begin
raw_response = @session.get("https://api.facebook.com/method/fql.query" + query_string)
rescue Patron::HostResolutionError
retry if tries < 5
tries += 1
rescue Patron::ConnectionFailed
rescue Patron::HostResolutionError, Patron::ConnectionFailed
retry if tries < 5
tries += 1
end
Expand Down Expand Up @@ -121,7 +116,7 @@ def valid?
end
end

@params
@is_valid
end

def [] k
Expand Down
2 changes: 1 addition & 1 deletion lib/facebook-graphclient/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def facebook(&blk)
instance_eval(&blk)
include Facebook::Rails
end
%w[ secret app_id access_token ].each do |param|
%w[ secret app_id api_key access_token ].each do |param|
class_eval %[
def #{param} val, &blk
facebook_settings[:#{param}] = val
Expand Down

0 comments on commit 792d4c3

Please sign in to comment.