Class: HttpStub::Server::Stub::Match::Rule::SimpleBody

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

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ SimpleBody

Returns a new instance of SimpleBody.



9
10
11
# File 'lib/http_stub/server/stub/match/rule/simple_body.rb', line 9

def initialize(body)
  @body = body
end

Instance Method Details

#matches?(request, _logger) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/http_stub/server/stub/match/rule/simple_body.rb', line 13

def matches?(request, _logger)
  HttpStub::Server::Stub::Match::StringValueMatcher.match?(@body, request.body)
end

#to_sObject



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

def to_s
  @body
end