lib/fireeagle/client.rb in mojodna-fireeagle-0.8.0.0 vs lib/fireeagle/client.rb in mojodna-fireeagle-0.8.0.1
- old
+ new
@@ -153,11 +153,11 @@
# * <tt>yahoo_local_id</tt>
# * <tt>plazes_id</tt>
def lookup(params)
raise FireEagle::ArgumentError, "OAuth Access Token Required" unless @access_token
response = get(FireEagle::LOOKUP_API_PATH, :params => params)
- FireEagle::Response.new(response.body).locations
+ FireEagle::Response.parse(response.body).locations
end
# Sets a User's current Location using using a Place ID hash or a set of Location parameters. If the User
# provides a Location unconfirmed with lookup then FireEagle makes a best guess as to the User's Location.
#
@@ -185,18 +185,18 @@
# * <tt>plazes_id</tt>
def update(location = {})
raise FireEagle::ArgumentError, "OAuth Access Token Required" unless @access_token
location = sanitize_location_hash(location)
response = post(FireEagle::UPDATE_API_PATH, :params => location)
- FireEagle::Response.new(response.body)
+ FireEagle::Response.parse(response.body)
end
# Returns the Location of a User.
def user
raise FireEagle::ArgumentError, "OAuth Access Token Required" unless @access_token
response = get(FireEagle::USER_API_PATH)
- FireEagle::Response.new(response.body).users.first
+ FireEagle::Response.parse(response.body).users.first
end
alias_method :location, :user
# Query for Users of an Application who have updated their Location recently. Returns a list of
# Users for the Application with recently updated locations.
@@ -208,11 +208,11 @@
# <tt>start</tt> The page number at which to start returning the list of users.
def recent(time = 'now', count = 10, start = 1)
raise FireEagle::ArgumentError, "OAuth Access Token Required" unless @access_token
params = { :count => count, :start => start, :time => time }
response = get(FireEagle::RECENT_API_PATH, :params => params)
- FireEagle::Response.new(response.body).users
+ FireEagle::Response.parse(response.body).users
end
# Takes a Place ID or a Location and returns a list of users of your application who are within the bounding box of that Location.
#
# Location Hash keys, in order of priority:
@@ -236,10 +236,10 @@
def within(location = {}, count = 10, start = 1)
raise FireEagle::ArgumentError, "OAuth Access Token Required" unless @access_token
location = sanitize_location_hash(location)
params = { :count => count, :start => start }.merge(location)
response = get(FireEagle::WITHIN_API_PATH, :params => params)
- FireEagle::Response.new(response.body).users
+ FireEagle::Response.parse(response.body).users
end
protected
def sanitize_location_hash(location)