File: metahelpers.rb

package info (click to toggle)
ruby-loofah 2.24.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240 kB
  • sloc: ruby: 1,824; makefile: 5
file content (18 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Loofah
  module MetaHelpers # :nodoc:
    class << self
      def add_downcased_set_members_to_all_set_constants(mojule)
        mojule.constants.each do |constant_sym|
          constant = mojule.const_get(constant_sym)
          next unless Set === constant

          constant.dup.each do |member|
            constant.add(member.downcase)
          end
        end
      end
    end
  end
end