Class: Amadeus::Namespaces::Safety::SafetyRatedLocations

Inherits:
Client::Decorator
  • Object
show all
Defined in:
lib/amadeus/namespaces/safety/safety_rated_locations.rb,
lib/amadeus/namespaces/safety/safety_rated_locations/by_square.rb

Overview

A namespaced client for the /v1/safety/safety_rated_locations/ endpoints

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.safety.safety_rated_locations

Defined Under Namespace

Classes: BySquare

Instance Method Summary collapse

Instance Method Details

#by_squareAmadeus::Namespaces::Safety::SafetyRatedLocations

The namespace for the Safe Place API:

Examples:

amadeus.safety.safety_rated_locations.by_square

Returns:



21
22
23
# File 'lib/amadeus/namespaces/safety/safety_rated_locations.rb', line 21

def by_square
  Amadeus::Namespaces::Safety::SafetyRatedLocations::BySquare.new(client)
end

#get(params = {}) ⇒ Amadeus::Response

Returns a list of relevant safety information near to a given point.

Examples:

What are the different safety information in Barcelona

amadeus.safety.safety_rated_locations.get(
  latitude: 41.397158,
  longitude: 2.160873
)

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :latitude (Double)

    latitude location to be at the center of the search circle - required

  • :longitude (Double)

    longitude location to be at the center of the search circle - required

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



40
41
42
# File 'lib/amadeus/namespaces/safety/safety_rated_locations.rb', line 40

def get(params = {})
  client.get('/v1/safety/safety-rated-locations', params)
end