Class: BrasilAPI::Address

Inherits:
Base
  • Object
show all
Defined in:
lib/brasil_api/address.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL

Class Method Summary collapse

Methods inherited from Base

get

Class Method Details

.find_by_zip_code(zip_code, location: false) ⇒ Object



6
7
8
9
10
# File 'lib/brasil_api/address.rb', line 6

def find_by_zip_code(zip_code, location: false)
  return get("/cep/v2/#{zip_code}") if location

  get("/cep/v1/#{zip_code}")
end

.state_and_cities_by_area_code(area_code) ⇒ Object



12
13
14
# File 'lib/brasil_api/address.rb', line 12

def state_and_cities_by_area_code(area_code)
  get("/ddd/v1/#{area_code}")
end