<commit_before>require_relative 'ext/definer/pseudo_method_list'

module PseudoObject
  class BasicObject < ::BasicObject
    attr_reader \
        :pseudo_object

    @@pseudo_substance = self
    @@pseudo_model = ::BasicObject

    class << self
      ModelExt::Definer::PseudoMethodList.define_methods(self)

      %w/
      pseudo_substance
      pseudo_model
      /.each do |method_name|
        define_method(method_name) do
          class_variable_get(:"@@#{method_name}")
        end
      end

      def pseudo_superclass
        nil
      end

      def wrap(object, **options)
        new(object, wrap: true, **options)
      end
    end

    # - - - - - - - - - - - - - - -
    # error

    TypeError = ::Class.new(::TypeError) {
      def initialize(object)
        message = '%s is not a kind of %s class' % [
            object.class,
            @@pseudo_model.name]
        super(message)
      end
    }

    # - - - - - - - - - - - - - - -
    # override - initialize

    def initialize(
        object,
        infection: true,
        wrap: false
        )
      self.pseudo_object = object
      self.pseudo_infection = infection
    end

    # - - - - - - - - - - - - - - -
    # pseudo original - set

    def pseudo_infection=(bool)
      @pseudo_infection = !!bool
    end

    def pseudo_object=(other)
      validate_pseudo_class(other)
      @pseudo_object = other
    end

    # - - - - - - - - - - - - - - -
    # pseudo original - get - bool

    def pseudo?
      true
    end<commit_msg>Change the way of wrapping<commit_after>require_relative 'ext/definer/pseudo_method_list'

module PseudoObject
  class BasicObject < ::BasicObject
    attr_reader \
        :pseudo_object

    @@pseudo_substance = self
    @@pseudo_model = ::BasicObject

    class << self
      ModelExt::Definer::PseudoMethodList.define_methods(self)

      %w/
      pseudo_substance
      pseudo_model
      /.each do |method_name|
        define_method(method_name) do
          class_variable_get(:"@@#{method_name}")
        end
      end

      def pseudo_superclass
        nil
      end

      def wrap(object, **options)
        allocate.pseudo_wrap(object, **options)
      end
    end

    # - - - - - - - - - - - - - - -
    # error

    TypeError = ::Class.new(::TypeError) {
      def initialize(object)
        message = '%s is not a kind of %s class' % [
            object.class,
            @@pseudo_model.name]
        super(message)
      end
    }

    # - - - - - - - - - - - - - - -
    # override - initialize
    # pseudo original - wrap

    def initialize(source, **options)
      self.pseudo_object = source
      pseudo_initialize_options(**options)
    end

    def pseudo_wrap(object, **options)
      self.pseudo_object = object
      pseudo_initialize_options(**options)

      self
    end

    def pseudo_initialize_options(
        infection: true
        )
      self.pseudo_infection = infection
    end
    private :pseudo_initialize_options

    # - - - - - - - - - - - - - - -
    # pseudo original - set

    def pseudo_infection=(bool)
      @pseudo_infection = !!bool
    end

    def pseudo_object=(other)
      validate_pseudo_class(other)
      @pseudo_object = other
    end

    # - - - - - - - - - - - - - - -
    # pseudo original - get - bool

    def pseudo?
      true
    end
{'fraction_non_alphanumeric': 0.11530398322851153, 'fraction_numerical': 0.0, 'mean_word_length': 1.6698641087130295, 'pattern_counts': {'":': 0, '<': 9, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3002402', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1033, 'n_words': 204}