# File lib/support/extended_regexp.rb, line 18
      def interpolate(*args)
        if args.length > 1
          replacements = Hash[*args]
        elsif args.first.kind_of?(Hash)
          replacements = args.first
        else
          raise ArgumentError, "Must pass hash to interpolate."
        end

        string = self.source

        replacements.each do |key, value|
          if key.kind_of?(Regexp)
            string.gsub!(key, value.to_s)
          else
            string.gsub!(/#{self.class.escape(key)}/im, value.to_s)
          end
        end

        string = (self.source.to_s).interpolate(*args)
        self.class.new(string, self.options)
      end