<commit_before>class GuessController < ApplicationController
  def create
    make_guess
  end

  private

  def make_guess
    guess_maker = MakeGuess.new(game, letter_to_guess)

    guess_maker.call

    set_errors(guess_maker.errors.first) unless guess_maker.errors.empty?

    route_to_game
  end

  def letter_to_guess
    params[:letter]
  end

  def game
    @game ||= Game.find(params[:game_id])
  end

  def set_errors(errors)
    flash[:alert] = errors
  end

  def route_to_game
    redirect_to controller: 'game', action: 'show', id: params[:game_id]
  end
end
<commit_msg>slight tidyup<commit_after>class GuessController < ApplicationController
  def create
    make_guess
  end

  private

  def make_guess
    guess_maker.call

    set_errors

    route_to_game
  end

  def guess_maker
    @guess_maker ||= MakeGuess.new(game, letter_to_guess)
  end

  def letter_to_guess
    params[:letter]
  end

  def game
    @game ||= Game.find(params[:game_id])
  end

  def set_errors
    flash[:alert] = guess_maker.errors.first unless guess_maker.errors.empty?
  end

  def route_to_game
    redirect_to controller: 'game', action: 'show', id: params[:game_id]
  end
end

{'fraction_non_alphanumeric': 0.08044030482641829, 'fraction_numerical': 0.0, 'mean_word_length': 3.528735632183908, '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': '4873373', 'n_tokens_mistral': 424, 'n_tokens_neox': 407, 'n_words': 92}