Method: TAM::API.getcoord

Defined in:
lib/tam/api/location.rb

.getcoord(user) ⇒ Hash

Find the location (coordinates) of a user

Returns:

  • (Hash)

    {"latitude"=>51.618,
     "timestamp"=>1302185772456,
     "accuracy"=>100,
     "longitude"=>23.9063,
    

    “status”=>{“code”=>0, “message”=>“Request was handled succesfully”}}



17
18
19
20
21
22
23
24
# File 'lib/tam/api/location.rb', line 17

def self.getcoord(user)
  begin
    response = dispatch_to_tam(:get, '/api/1/location/getcoord', user)
    JSON.parse response
  rescue TAM::ServiceUnavailable
    raise TAM::ServiceUnavailable.new 'The location service is not available. If you are using the service on a persona, i.e.: through the sandbox, then remember to set the location of the persona'
  end
end