<commit_before>require 'rom/initializer'
require 'rom/relation/materializable'

require 'rom/repository/relation_proxy/combine'
require 'rom/repository/relation_proxy/wrap'

module ROM
  class Repository
    # RelationProxy decorates a relation and automatically generates mappers that
    # will map raw tuples into rom structs
    #
    # Relation proxies are being registered within repositories so typically there's
    # no need to instantiate them manually.
    #
    # @api public
    class RelationProxy
      extend Initializer
      include Relation::Materializable

      (Kernel.private_instance_methods - %i(raise)).each(&method(:undef_method))

      include RelationProxy::Combine
      include RelationProxy::Wrap

      RelationRegistryType = Types.Definition(RelationRegistry).constrained(type: RelationRegistry)

      # @!attribute [r] relation
      #   @return [Relation, Relation::Composite, Relation::Graph, Relation::Curried] The decorated relation object
      param :relation

      option :name, type:  Types::Strict::Symbol
      option :mappers, default: -> { MapperBuilder.new }
      option :meta, default: -> { EMPTY_HASH }
      option :registry, type: RelationRegistryType, default: -> { RelationRegistry.new }
      option :auto_struct, default: -> { true }

      # Relation name
      #
      # @return [ROM::Relation::Name]
      #
      # @api public
      def name<commit_msg>Deprecate combine_children, combine_parents and wrap_parent<commit_after>require 'dry/core/deprecations'

require 'rom/initializer'
require 'rom/relation/materializable'

require 'rom/repository/relation_proxy/combine'
require 'rom/repository/relation_proxy/wrap'

module ROM
  class Repository
    # RelationProxy decorates a relation and automatically generates mappers that
    # will map raw tuples into rom structs
    #
    # Relation proxies are being registered within repositories so typically there's
    # no need to instantiate them manually.
    #
    # @api public
    class RelationProxy
      extend Initializer
      extend Dry::Core::Deprecations[:rom]

      include Relation::Materializable

      (Kernel.private_instance_methods - %i(raise)).each(&method(:undef_method))

      include RelationProxy::Combine
      include RelationProxy::Wrap

      deprecate :combine_parents
      deprecate :combine_children
      deprecate :wrap_parent

      RelationRegistryType = Types.Definition(RelationRegistry).constrained(type: RelationRegistry)

      # @!attribute [r] relation
      #   @return [Relation, Relation::Composite, Relation::Graph, Relation::Curried] The decorated relation object
      param :relation

      option :name, type:  Types::Strict::Symbol
      option :mappers, default: -> { MapperBuilder.new }
      option :meta, default: -> { EMPTY_HASH }
      option :registry, type: RelationRegistryType, default: -> { RelationRegistry.new }
      option :auto_struct, default: -> { true }

      # Relation name
      #
      # @return [ROM::Relation::Name]
      #
      # @api public
      def name
{'fraction_non_alphanumeric': 0.0893909626719057, 'fraction_numerical': 0.0, 'mean_word_length': 3.4926470588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '231838', 'n_tokens_mistral': 857, 'n_tokens_neox': 827, 'n_words': 223}