Sha256: f1e5003f515472123e9768a83b5bd2868b3439afef83daa6317f4da6148d656a

Contents?: true

Size: 264 Bytes

Versions: 17

Compression:

Stored size: 264 Bytes

Contents

# frozen_string_literal: true
class VerbServlet < WEBrick::HTTPServlet::AbstractServlet
  %w[HEAD GET POST PUT DELETE].each do |verb|
    define_method "do_#{verb}" do |req, res|
      res.header['X-Request-Method'] = verb
      res.body = verb
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mechanize-2.14.0 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.13.0 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.12.2 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.12.1 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.12.0 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.11.0 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.10.1 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.10.0 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.9.2 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.9.1 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.9.0 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.8.5 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.8.4 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.8.3 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.8.2 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.8.1 lib/mechanize/test_case/verb_servlet.rb
mechanize-2.8.0 lib/mechanize/test_case/verb_servlet.rb