class Bosta::City

This class represents the citoes that your addresses will contain in creating deliveries and pickups.

Public Class Methods

find_all_cities() click to toggle source

Get all cities names and codes.

Here you will find all city codes that you will need to provide in creating shipments and pickups.

An Error is raised if the endpoint didn't return data

# File lib/bosta/cities/city.rb, line 15
def self.find_all_cities
  Bosta::Resource.send('get', 'cities')
end
show_city_zones(city_id) click to toggle source

Get all zones in a specific city.

cityId represents the city id for which zones is obtained an exception raises.

An Error is raised if the endpoint didn't return data or wrong cityId was given

# File lib/bosta/cities/city.rb, line 27
def self.show_city_zones(city_id)
  Bosta::Resource.send('get', "cities/#{city_id}/zones")
end