<commit_before>module DataMapper
  module Relation

    class Header

      # Build a new {Header} instance
      #
      # @param [Symbol] relation_name
      #   the name of the relation
      #
      # @param [Enumerable<Symbol>] attribute_names
      #   the set of attribute names to build the index for
      #
      # @param [Class] strategy_class
      #   the strategy class to use for joining
      #
      # @return [Header]
      #
      # @api private
      def self.build(relation_name, attribute_names, strategy_class)
        a_idx = AttributeIndex.build(relation_name, attribute_names, strategy_class)
        r_idx = RelationIndex.build(a_idx)

        new(a_idx, r_idx)
      end

      include Enumerable, Adamantium, Equalizer.new(:attribute_index)

      # The aliases for renaming the right side relation after a {#join}
      #
      # @return [Hash<Symbol, Symbol>]
      #
      # @api private
      attr_reader :aliases

      # Initialize a new instance
      #
      # @param [AttributeIndex] attribute_index
      #   the attribute index used by this instance
      #
      # @param [Hash] aliases
      #   the aliases used by this instance
      #
      # @return [undefined]
      #
      # @api private
      def initialize(attribute_index, relation_index, aliases = EMPTY_HASH)
        @attribute_index = attribute_index
        @relation_index  = relation_index

        @aliases = aliases
        @header  = @attribute_index.header
      end

      # Iterate over the header's attributes
      #
      # @yield [attribute]
      #
      # @yieldparam [Attribute] attribute
      #   a header attribute
      #
      # @return [self, Enumerator]
      #
      # @api private
      def each(&block)
        return to_enum unless block_given?
        @header.each(&block)
        self
      end<commit_msg>Fix docs for Relation::Header#initialize<commit_after>module DataMapper
  module Relation

    class Header

      # Build a new {Header} instance
      #
      # @param [Symbol] relation_name
      #   the name of the relation
      #
      # @param [Enumerable<Symbol>] attribute_names
      #   the set of attribute names to build the index for
      #
      # @param [Class] strategy_class
      #   the strategy class to use for joining
      #
      # @return [Header]
      #
      # @api private
      def self.build(relation_name, attribute_names, strategy_class)
        a_idx = AttributeIndex.build(relation_name, attribute_names, strategy_class)
        r_idx = RelationIndex.build(a_idx)

        new(a_idx, r_idx)
      end

      include Enumerable, Adamantium, Equalizer.new(:attribute_index)

      # The aliases for renaming the right side relation after a {#join}
      #
      # @return [Hash<Symbol, Symbol>]
      #
      # @api private
      attr_reader :aliases

      # Initialize a new instance
      #
      # @param [AttributeIndex] attribute_index
      #   the attribute index used by this instance
      #
      # @param [RelationIndex] relation_index
      #   the relation index used by this instance
      #
      # @param [Hash<Symbol, Symbol>] aliases
      #   the aliases for the right side relation after a {#join}
      #
      # @return [undefined]
      #
      # @api private
      def initialize(attribute_index, relation_index, aliases = EMPTY_HASH)
        @attribute_index = attribute_index
        @relation_index  = relation_index

        @aliases = aliases
        @header  = @attribute_index.header
      end

      # Iterate over the header's attributes
      #
      # @yield [attribute]
      #
      # @yieldparam [Attribute] attribute
      #   a header attribute
      #
      # @return [self, Enumerator]
      #
      # @api private
      def each(&block)
        return to_enum unless block_given?
        @header.each(&block)
        self
      end
{'fraction_non_alphanumeric': 0.07714285714285714, 'fraction_numerical': 0.0, 'mean_word_length': 2.115695792880259, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '4313276', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1069, 'n_words': 315}