lib/weather_hacker/client.rb
def city_id_by_zipcode(zipcode)
      zipcode = canonical_zipcode(zipcode)
      return unless valid_zipcode?(zipcode)

      @city_id_by_zipcode[zipcode] ||= begin
        hash = info_by_zipcode(zipcode)
        city = canonical_city(hash["city"])
        pref = canonical_pref(hash["state"])
        city_id_by_area(city, pref).to_i
      end
    end
# return city id via zipcode API
return city id via zipcode API
return city id via zipcode API
def city_id_by_zipcode(zipcode)
      zipcode = canonical_zipcode(zipcode)
      return unless valid_zipcode?(zipcode)
      @city_id_by_zipcode[zipcode] ||= begin
        hash = info_by_zipcode(zipcode)
        city = canonical_city(hash["city"])
        pref = canonical_pref(hash["state"])
        city_id_by_area(city, pref).to_i
      end
    end
def city_id_by_zipcode ( zipcode ) zipcode = canonical_zipcode ( zipcode ) return unless valid_zipcode? ( zipcode ) @city_id_by_zipcode [ zipcode ] ||= begin hash = info_by_zipcode ( zipcode ) city = canonical_city ( hash [ "city" ] ) pref = canonical_pref ( hash [ "state" ] ) city_id_by_area ( city , pref ) . to_i end end
return city id via zipcode API
return city id via zipcode API
zipcode