Module: Mercadolibre::Core::Locations

Included in:
Api
Defined in:
lib/mercadolibre/core/locations.rb

Instance Method Summary collapse

Instance Method Details

#get_city(city_id) ⇒ Object



16
17
18
# File 'lib/mercadolibre/core/locations.rb', line 16

def get_city(city_id)
  get_request("/cities/#{city_id}").body
end

#get_countriesObject



4
5
6
# File 'lib/mercadolibre/core/locations.rb', line 4

def get_countries
  get_request('/countries').body
end

#get_country(country_id) ⇒ Object



8
9
10
# File 'lib/mercadolibre/core/locations.rb', line 8

def get_country(country_id)
  get_request("/countries/#{country_id}").body
end

#get_state(state_id) ⇒ Object



12
13
14
# File 'lib/mercadolibre/core/locations.rb', line 12

def get_state(state_id)
  get_request("/states/#{state_id}").body
end

#get_zip_code(country_id, zip_code) ⇒ Object



20
21
22
# File 'lib/mercadolibre/core/locations.rb', line 20

def get_zip_code(country_id, zip_code)
  get_request("/countries/#{country_id}/zip_codes/#{zip_code}").body
end

#search_zip_codes(country_id, zip_code_from, zip_code_to) ⇒ Object



24
25
26
27
28
29
# File 'lib/mercadolibre/core/locations.rb', line 24

def search_zip_codes(country_id, zip_code_from, zip_code_to)
  get_request("/countries/#{country_id}/zip_codes/search_between", {
    zip_code_from: zip_code_from,
    zip_code_to: zip_code_to
  }).body
end