<commit_before># frozen_string_literal: true

module GraphQL
  class Schema
    class Member
      module HasDirectives
        # Create an instance of `dir_class` for `self`, using `options`.
        #
        # It removes a previously-attached instance of `dir_class`, if there is one.
        #
        # @return [void]
        def directive(dir_class, **options)
          @own_directives ||= []
          remove_directive(dir_class)
          @own_directives << dir_class.new(self, **options)
          nil
        end

        # Remove an attached instance of `dir_class`, if there is one
        # @param dir_class [Class<GraphQL::Schema::Directive>]
        # @return [viod]
        def remove_directive(dir_class)
          @own_directives && @own_directives.reject! { |d| d.is_a?(dir_class) }
          nil
        end

        NO_DIRECTIVES = [].freeze

        def directives
          case self
          when Class<commit_msg>Allow multiples of repeatable directives<commit_after># frozen_string_literal: true

module GraphQL
  class Schema
    class Member
      module HasDirectives
        # Create an instance of `dir_class` for `self`, using `options`.
        #
        # It removes a previously-attached instance of `dir_class`, if there is one.
        #
        # @return [void]
        def directive(dir_class, **options)
          @own_directives ||= []
          remove_directive(dir_class) unless dir_class.repeatable?
          @own_directives << dir_class.new(self, **options)
          nil
        end

        # Remove an attached instance of `dir_class`, if there is one
        # @param dir_class [Class<GraphQL::Schema::Directive>]
        # @return [viod]
        def remove_directive(dir_class)
          @own_directives && @own_directives.reject! { |d| d.is_a?(dir_class) }
          nil
        end

        NO_DIRECTIVES = [].freeze

        def directives
          case self
          when Class
{'fraction_non_alphanumeric': 0.08987603305785125, 'fraction_numerical': 0.0, 'mean_word_length': 2.1547231270358305, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '6071119', 'n_tokens_mistral': 564, 'n_tokens_neox': 550, 'n_words': 153}