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



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

def delete(path)
  create_basic_request(:delete, path)
end

.get(path) ⇒ Object



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

def get(path)
  create_basic_request(:get, path.start_with?("/") ? path : "/#{path}")
end

.multipart(model) ⇒ Object



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

def multipart(model)
  HttpStub::Configurer::Request::Http::Multipart.new(model)
end

.post(path, parameters = {}) ⇒ Object



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

def post(path, parameters={})
  create_basic_request(:post, path) { |http_request| http_request.set_form_data(parameters) }
end