<commit_before>module Twigg
  class App
    module Routes
      def author_path(author)
        '/authors/' + author.tr(' ', '.')
      end

      def authors_path(options = {})
        '/authors' + (options.empty? ? '' : "?#{::URI.encode_www_form(options)}")
      end

      def pairs_path(options = {})
        '/pairs' + (options.empty? ? '' : "?#{::URI.encode_www_form(options)}")
      end

      def team_path(team)
        '/teams/' + team.tr(' ', '.')
      end

      def teams_path(options = {})
        '/teams' + (options.empty? ? '' : "?#{::URI.encode_www_form(options)}")
      end
    end
  end
end<commit_msg>Apply minor DRY-up in the routes helpers<commit_after>module Twigg
  class App
    module Routes
      def author_path(author)
        '/authors/' + author.tr(' ', '.')
      end

      def authors_path(options = {})
        '/authors' + query_string_from_options(options)
      end

      def pairs_path(options = {})
        '/pairs' + query_string_from_options(options)
      end

      def team_path(team)
        '/teams/' + team.tr(' ', '.')
      end

      def teams_path(options = {})
        '/teams' + query_string_from_options(options)
      end

    private

      def query_string_from_options(options)
        options.empty? ? '' : "?#{::URI.encode_www_form(options)}"
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.15482423335826478, 'fraction_numerical': 0.0, 'mean_word_length': 2.2397094430992737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5270791', 'n_tokens_mistral': 443, 'n_tokens_neox': 442, 'n_words': 82}