Class: HttpStub::Server::Stub::RequestBody

Inherits:
Object
  • Object
show all
Defined in:
lib/http_stub/server/stub/request_body.rb

Class Method Summary collapse

Class Method Details

.create(body) ⇒ Object



15
16
17
18
19
# File 'lib/http_stub/server/stub/request_body.rb', line 15

def create(body)
  matcher = create_schema_request_body(body["schema"]) if body.is_a?(Hash) && body["schema"]
  matcher ||= HttpStub::Server::Stub::SimpleRequestBody.new(body) if !body.blank?
  matcher || HttpStub::Server::Stub::TruthyRequestMatcher
end