Hi. This gem allows you to perform the following conversions:
Area uses public domain data and does not rely on any external services (the internets). Usage is meant to be more lightweight than the Geocoder gem.
In your gemfile: gem 'area'
646.to_region #=> NY
"AK".to_area #=> ["907"]
"CT".to_area #=> ["203", "860"]
"long island city, ny".to_zip #=> ["11101", "11109", "11120"]
"hastings on hudson".to_zip #=> ["10706"]
"11211".to_region #=> "Brooklyn, NY"
"11211".to_region(:city => true) #=> "Brooklyn"
"11211".to_region(:state => true) #=> "NY"
"11211".to_latlon #=> "40.71209, -73.95427"
"11211".to_lat #=> "40.71209"
"11211".to_lon #=> "-73.95427"
"11211".to_gmt_offset #=> "-5"
"NY".to_gmt_offset #=> "-5" # by state
"11211".observes_dst? #=> true
"NY".observes_dst? #=> true # by state
[40.71209, -73.95427].to_zip #=> "11211"
[40.71209, -73.95427].to_region #=> "Brooklyn, NY"
[40.71209, -73.95427].to_gmt_offset #=> "-5"
[40.71209, -73.95427].observes_dst? #=> true
Contributions are more than welcome. I'm testing with minitest. This gem supports:
Copyright (c) 2012 Jonathan Vingiano. See LICENSE for details.