<commit_before>require 'clients'
module Jobs
  class Coords
    class << self
      def add_to(need)
        client  = Maps.new
        address = location(need)
        coords  = client.coords(address: address)
        update_need!(need, coords) if coords
      end

      def update_need!(need, coords)
        need.update_attributes(lat: coords.lat, lng: coords.lng)
      end

      def location(need)
        city, place = need.city, need.location
        return "%s, %s" % [city, place]
      end
    end
  end
end<commit_msg>Switch place and city in google request<commit_after>require 'clients'
module Jobs
  class Coords
    class << self
      def add_to(need)
        client  = Maps.new
        address = location(need)
        coords  = client.coords(address: address)
        update_need!(need, coords) if coords
      end

      def update_need!(need, coords)
        need.update_attributes(lat: coords.lat, lng: coords.lng)
      end

      def location(need)
        city, place = need.city, need.location
        return "%s, %s" % [place, city]
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09375, 'fraction_numerical': 0.0, 'mean_word_length': 2.2314540059347183, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6842749', 'n_tokens_mistral': 351, 'n_tokens_neox': 342, 'n_words': 95}