Module: Vigiles::Archive

Extended by:
T::Sig
Defined in:
lib/vigiles/archive.rb,
lib/vigiles/archive/extras.rb,
lib/vigiles/archive/request.rb,
lib/vigiles/archive/metadata.rb,
lib/vigiles/archive/response.rb,
lib/vigiles/archive/parameter.rb,
lib/vigiles/archive/conversation.rb

Defined Under Namespace

Classes: Conversation, Extras, Metadata, Parameter, Request, Response, UnrecordableRequestError

Constant Summary collapse

Types =
Vigiles::Types
ContentType =
Types::ContentType

Class Method Summary collapse

Class Method Details

.record_conversation(req:, res:) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/vigiles/archive.rb', line 20

def self.record_conversation(req:, res:)
  content_type = req.content_type
  if (recorder = Vigiles.spec.recorders[content_type]).nil?
    raise \
      UnrecordableRequestError,
      "no recorder configured for content type: #{content_type}"
  end

  recorder.record(req:, res:)
end