<commit_before>module Blush
  module HasPresenter
    def has_presenter(accessor_name = {}, options = nil)
      class_attribute :blush_options

      options, accessor_name = accessor_name, options unless options
      self.blush_options = options

      define_method(accessor_name || Blush.config.accessor_name) do
        @presenter ||= (self.blush_options[:class] || "#{self.model_name}Presenter").constantize.new(self)
      end

      define_method(self.blush_options[:helper_name] || Blush.config.helper_name) do |method, *args, &block|
        presenter.try(method, *args, &block) || send(method, *args, &block)
      end
    end
  end
end<commit_msg>Accessor instance variable is now the same name as accessor<commit_after>module Blush
  module HasPresenter
    def has_presenter(accessor_name = {}, options = nil)
      class_attribute :blush_options

      options, accessor_name = accessor_name, options unless options
      self.blush_options = options
      self.blush_options[:accessor_name] = accessor_name || Blush.config.accessor_name

      define_method(self.blush_options[:accessor_name]) do
        accessor_name = "@#{self.blush_options[:accessor_name]}"
        presenter_class = (self.blush_options[:class] || "#{self.model_name}Presenter").constantize
        instance_variable_get(accessor_name) || instance_variable_set(accessor_name, presenter_class.new(self))
      end

      define_method(self.blush_options[:helper_name] || Blush.config.helper_name) do |method, *args, &block|
        presenter.try(method, *args, &block) || send(method, *args, &block)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10780669144981413, 'fraction_numerical': 0.0, 'mean_word_length': 4.159744408945687, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5255726', 'n_tokens_mistral': 508, 'n_tokens_neox': 502, 'n_words': 97}