lib/weather_hacker/client.rb
def id_by_pref
      @id_by_pref ||= pref_by_city.inject({}) { |hash, item|
        k, v = item
        hash[k] ||= v
        hash
      }
    end
# return typical city's id
return typical city's id
return typical city ' s id
def id_by_pref
      @id_by_pref ||= pref_by_city.inject({}) { |hash, item|
        k, v = item
        hash[k] ||= v
        hash
      }
    end
def id_by_pref @id_by_pref ||= pref_by_city . inject ( { } ) { | hash , item | k , v = item hash [ k ] ||= v hash } end
return typical city's id
return typical city ' s id