Sha256: 913e8de46d894ba351b0e4885959559a20413a21f905f86dcefb45389711023e

Contents?: true

Size: 940 Bytes

Versions: 1

Compression:

Stored size: 940 Bytes

Contents

# frozen_string_literal: true

module Niso
  module Jats
    class ModuleIncluder
      TARGET_CLASSES = %w[
        AltTitle
        ArticleTitle
        Attrib
        Bold
        Comment
        DefHead
        FixedCase
        Italic
        MetaValue
        Monospace
        Overline
        Roman
        Sc
        See
        SeeAlso
        Strike
        Sub
        Subtitle
        Sup
        Term
        TermHead
        Title
        TransSubtitle
        TransTitle
        Underline
      ].freeze

      def self.include_basic_text
        TARGET_CLASSES.each do |class_name|
          full_class_name = "Niso::Jats::#{class_name}"
          klass = Object.const_get(full_class_name)
          klass.include Niso::Jats::BasicText if klass.is_a?(Class)
        rescue NameError
          puts "Class #{full_class_name} not found."
        end
      end
    end
  end
end

Niso::Jats::ModuleIncluder.include_basic_text

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
niso-jats-0.1.1 lib/niso/jats/module_includer.rb