Method: ZipCode.find
- Defined in:
- lib/zip_code.rb
.find(province, city, district = '') ⇒ Object
4 5 6 7 8 9 |
# File 'lib/zip_code.rb', line 4 def self.find province, city, district = '' return '' if ZipCode::MAPPING[province].nil? return '' if ZipCode::MAPPING[province][city].nil? return ZipCode::MAPPING[province][city].first[1] if district.empty? return ZipCode::MAPPING[province][city][district] || '' end |