Class: HttpStub::Configurer::Request::Http::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/http_stub/configurer/request/http/factory.rb

Class Method Summary collapse

Class Method Details

.delete(path) ⇒ Object



26
27
28
# File 'lib/http_stub/configurer/request/http/factory.rb', line 26

def delete(path)
  to_basic_request(Net::HTTP::Delete.new(path))
end

.get(path) ⇒ Object



18
19
20
# File 'lib/http_stub/configurer/request/http/factory.rb', line 18

def get(path)
  to_basic_request(Net::HTTP::Get.new(path))
end

.post(path) ⇒ Object



22
23
24
# File 'lib/http_stub/configurer/request/http/factory.rb', line 22

def post(path)
  to_basic_request(Net::HTTP::Post.new(path).tap { |request| request.body = "" })
end

.stub(model) ⇒ Object



10
11
12
# File 'lib/http_stub/configurer/request/http/factory.rb', line 10

def stub(model)
  HttpStub::Configurer::Request::Http::Multipart.new("/stubs", model)
end

.stub_activator(model) ⇒ Object



14
15
16
# File 'lib/http_stub/configurer/request/http/factory.rb', line 14

def stub_activator(model)
  HttpStub::Configurer::Request::Http::Multipart.new("/stubs/activators", model)
end