Class: HttpStub::Server::Stub::Match::Rule::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/http_stub/server/stub/match/rule/body.rb

Class Method Summary collapse

Class Method Details

.create(body) ⇒ Object



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

def create(body)
  matcher = create_schema_body(body["schema"]) if body.is_a?(Hash) && body["schema"]
  matcher ||= HttpStub::Server::Stub::Match::Rule::SimpleBody.new(body) if body.present?
  matcher || HttpStub::Server::Stub::Match::Rule::Truthy
end