@zipcode = ZipCodes.identify(params[:zip_code])
I am new to rails. Can anyone tell me what does the keyword 'identify' do. Is this related to active record query?
Thank you in advance.
The gem zip-codes provides the ZipCodes
class with a identify
class method that simply reads a zip code and returns the state, city and timezone.
ZipCodes.identify('30301')
# => {:state_code=>"GA", :state_name=>"Georgia", :city=>"Atlanta", :time_zone=>"America/New_York"}
How do I/you know this? I guess you are new to the project where you saw this line:
ZipCodes
or similar? Yes, search for the gem documentation.ZipCodes.identify
and search among the results.Here is the documentation for zip-codes : https://github.com/monterail/zip-codes
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.