Class: WebMock::RequestBodyDiff

Inherits:
Object
  • Object
show all
Defined in:
lib/webmock/request_body_diff.rb

Instance Method Summary collapse

Constructor Details

#initialize(request_signature, request_stub) ⇒ RequestBodyDiff

Returns a new instance of RequestBodyDiff.



7
8
9
10
# File 'lib/webmock/request_body_diff.rb', line 7

def initialize(request_signature, request_stub)
  @request_signature = request_signature
  @request_stub      = request_stub
end

Instance Method Details

#body_diffObject



12
13
14
15
16
# File 'lib/webmock/request_body_diff.rb', line 12

def body_diff
  return {} unless request_signature_diffable? && request_stub_diffable?

  Hashdiff.diff(request_signature_body_hash, request_stub_body_hash)
end