<commit_before>require 'xml/mapping_extensions'

module Datacite
  module Mapping
    class AlternateIdentifier
      include XML::Mapping

      root_element_name 'alternateIdentifier'

      text_node :_type, '@alternateIdentifierType'
      text_node :_value, 'text()'

      def initialize(type:, value:)
        self.type = type
        self.value = value
      end

      def type
        _type
      end

      def type=(val)
        fail ArgumentError, 'No identifier type provided' unless val
        self._type = val
      end

      def value
        _value
      end

      def value=(val)
        fail ArgumentError, 'No identifier value provided' unless val
        self._value = val
      end
    end

    # Not to be instantiated directly -- just call `Resource#alternate_identifiers`
    class AlternateIdentifiers
      include XML::Mapping

      array_node :alternate_identifiers, 'alternateIdentifier', class: AlternateIdentifier

      def initialize(alternate_identifiers:)
        self.alternate_identifiers = alternate_identifiers || []
      end
    end
  end
end<commit_msg>Added root element name<commit_after>require 'xml/mapping_extensions'

module Datacite
  module Mapping
    class AlternateIdentifier
      include XML::Mapping

      root_element_name 'alternateIdentifier'

      text_node :_type, '@alternateIdentifierType'
      text_node :_value, 'text()'

      def initialize(type:, value:)
        self.type = type
        self.value = value
      end

      def type
        _type
      end

      def type=(val)
        fail ArgumentError, 'No identifier type provided' unless val
        self._type = val
      end

      def value
        _value
      end

      def value=(val)
        fail ArgumentError, 'No identifier value provided' unless val
        self._value = val
      end
    end

    # Not to be instantiated directly -- just call `Resource#alternate_identifiers`
    class AlternateIdentifiers
      include XML::Mapping

      root_element_name 'alternateIdentifiers'

      array_node :alternate_identifiers, 'alternateIdentifier', class: AlternateIdentifier

      def initialize(alternate_identifiers:)
        self.alternate_identifiers = alternate_identifiers || []
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.061946902654867256, 'fraction_numerical': 0.0, 'mean_word_length': 2.4945904173106648, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6805686', 'n_tokens_mistral': 618, 'n_tokens_neox': 590, 'n_words': 176}