validate_url_filter

in lib/crawler/data/extraction/url_filter.rb [25:42]


        def validate_url_filter
          unless TYPES.include?(@type)
            raise ArgumentError,
                  "Extraction ruleset url_filter `#{@type}` is invalid; value must be one of #{TYPES.join(', ')}"
          end

          raise ArgumentError, 'Extraction ruleset url_filter pattern can not be blank' if @pattern.blank?

          case @type
          when 'begins'
            unless @pattern.start_with?('/')
              raise ArgumentError,
                    'Extraction ruleset url_filter pattern must begin with a slash (/) if type is `begins`'
            end
          when 'regex' then validate_regex
          end
        end