<commit_before>module Api
  module V1
    class RepsController < ApplicationController
      respond_to :json

      def index
        respond_with Rep.all
      end

    end
  end
end<commit_msg>changes<commit_after>module Api
  module V1
    class RepsController < ApplicationController
      respond_to :json

      def index
        address = params[:address]
        lat     = params[:lat]
        long    = params[:long]
        state   = params[:state]
        # return the first result, or a random one
        @reps = if params
                  Rep.find_em address: address, lat: lat, long: long, state: state
                else
                  # Would like to find requesting IP address, geocode it and return the closest rep
                  # request = Rack::Request.new Rails.env
                  # result = request.location
                  # @office = OfficeLocation.near(result.postal_code)
                  # @reps = @office.rep
                  []
                end
                respond_with @reps
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.061378659112370164, 'fraction_numerical': 0.0018885741265344666, 'mean_word_length': 1.5542168674698795, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3004324', 'n_tokens_mistral': 285, 'n_tokens_neox': 267, 'n_words': 86}