Sha256: 0e1c9b5ee925c22e990fced9295c6e6745a59df13789ebbb6de590675c63a3ae

Contents?: true

Size: 567 Bytes

Versions: 6

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

module CrawlerDetect
  # @since 0.1.0
  module Library
    DATA_CLASSES = [Library::Headers, Library::Exclusions, Library::Crawlers].freeze

    class << self
      # @param param [String] Name of raw data
      # @return [Regexp]
      def get_regexp(param)
        data = get_array(param)
        %r{#{data.join('|')}}i
      end

      # @param param [String] Name of raw data
      # @return [Array]
      def get_array(param)
        const_get("CrawlerDetect::Library::#{param.capitalize}").send(:data)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
crawler_detect-1.1.2 lib/crawler_detect/library.rb
crawler_detect-1.1.1 lib/crawler_detect/library.rb
crawler_detect-1.1.0 lib/crawler_detect/library.rb
crawler_detect-1.0.2 lib/crawler_detect/library.rb
crawler_detect-1.0.1 lib/crawler_detect/library.rb
crawler_detect-1.0.0 lib/crawler_detect/library.rb