<commit_before>module Rddd
  module AggregateRootFinders
    def finder(name, &block)
      (class << self; self; end).instance_eval do
        define_method name do |*args|
          repository.send(name, *args)
        end
      end
    end

    def repository
      RepositoryFactory.build(self)
    end<commit_msg>refactor finders<commit_after>module Rddd
  module AggregateRootFinders
    def finder(name)
      craete_static_method(name) do |*args|
        repository.send(name, *args)
      end
    end

    def repository
      RepositoryFactory.build(self)
    end

    private

    def craete_static_method(name, &block)
      (class << self; self; end).instance_eval do
        define_method name, &block
      end
    end
{'fraction_non_alphanumeric': 0.07639836289222374, 'fraction_numerical': 0.0, 'mean_word_length': 2.563106796116505, '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': '5696575', 'n_tokens_mistral': 232, 'n_tokens_neox': 221, 'n_words': 56}