Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/geoinfo/string.rb
Instance Method Summary collapse
Instance Method Details
#to_region(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/geoinfo/string.rb', line 3 def to_region( = {}) Geoinfo::ZIP_CODES.each do |row| if row.second == self.to_s if [:district] @region = row[5] elsif [:state] @region = row[3] elsif [:country] @region = row[0] elsif [:lat] @region = row[9] elsif [:log] @region = row[10] elsif [:state_code] @region = row[4] else @region = row[2] end end end @region || nil end |