Class: HttpStub::Configurer::Request::Http::Factory
- Inherits:
-
Object
- Object
- HttpStub::Configurer::Request::Http::Factory
- Defined in:
- lib/http_stub/configurer/request/http/factory.rb
Class Method Summary collapse
- .activate(uri) ⇒ Object
- .delete(path) ⇒ Object
- .get(path) ⇒ Object
- .post(path) ⇒ Object
- .scenario(model) ⇒ Object (also: stub_activator)
- .stub(model) ⇒ Object
Class Method Details
.activate(uri) ⇒ Object
20 21 22 |
# File 'lib/http_stub/configurer/request/http/factory.rb', line 20 def activate(uri) get(uri.start_with?("/") ? uri : "/#{uri}") end |
.delete(path) ⇒ Object
32 33 34 |
# File 'lib/http_stub/configurer/request/http/factory.rb', line 32 def delete(path) to_basic_request(Net::HTTP::Delete.new(path)) end |
.get(path) ⇒ Object
24 25 26 |
# File 'lib/http_stub/configurer/request/http/factory.rb', line 24 def get(path) to_basic_request(Net::HTTP::Get.new(path)) end |
.post(path) ⇒ Object
28 29 30 |
# File 'lib/http_stub/configurer/request/http/factory.rb', line 28 def post(path) to_basic_request(Net::HTTP::Post.new(path).tap { |request| request.body = "" }) end |