Class: Pact::Consumer::InteractionReplay

Inherits:
Object
  • Object
show all
Includes:
RackRequestHelper, Matchers
Defined in:
lib/pact/consumer/mock_service/interaction_replay.rb

Constant Summary

Constants included from RackRequestHelper

RackRequestHelper::REQUEST_KEYS

Constants included from Matchers

Matchers::DEFAULT_OPTIONS, Matchers::NO_DIFF_INDICATOR

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RackRequestHelper

#params_hash, #request_as_hash_from

Methods included from Matchers

#actual_array_diff, #actual_hash_diff, #array_diff, #check_for_unexpected_keys, #class_diff, #classes_match?, #diff, #hash_diff, #object_diff, #regexp_diff, #structure_diff, #structure_diff_actual_display, #structure_diff_expected_display

Constructor Details

#initialize(name, logger, interaction_list) ⇒ InteractionReplay

Returns a new instance of InteractionReplay.



13
14
15
16
17
# File 'lib/pact/consumer/mock_service/interaction_replay.rb', line 13

def initialize name, logger, interaction_list
  @name = name
  @logger = logger
  @interaction_list = interaction_list
end

Instance Attribute Details

#interaction_listObject

Returns the value of attribute interaction_list.



11
12
13
# File 'lib/pact/consumer/mock_service/interaction_replay.rb', line 11

def interaction_list
  @interaction_list
end

#loggerObject

Returns the value of attribute logger.



11
12
13
# File 'lib/pact/consumer/mock_service/interaction_replay.rb', line 11

def logger
  @logger
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/pact/consumer/mock_service/interaction_replay.rb', line 11

def name
  @name
end

Instance Method Details

#match?(env) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/pact/consumer/mock_service/interaction_replay.rb', line 19

def match? env
  true # default handler
end

#respond(env) ⇒ Object



23
24
25
# File 'lib/pact/consumer/mock_service/interaction_replay.rb', line 23

def respond env
  find_response request_as_hash_from(env)
end