Class: RightDevelop::Testing::Server::MightApi::App::Playback

Inherits:
Base
  • Object
show all
Defined in:
lib/right_develop/testing/servers/might_api/app/playback.rb

Constant Summary collapse

STATE_FILE_NAME =
'playback_state.yml'

Constants inherited from Base

Base::DEFAULT_PROXY_SETTINGS, Base::MAX_REDIRECTS, Base::MUTEX

Instance Attribute Summary

Attributes inherited from Base

#config, #logger, #state_file_path

Instance Method Summary collapse

Methods inherited from Base

app_threads, #call, #cleanup, interrupted=, interrupted?

Constructor Details

#initialize(options = {}) ⇒ Playback

Returns a new instance of Playback.

See Also:



31
32
33
34
35
# File 'lib/right_develop/testing/servers/might_api/app/playback.rb', line 31

def initialize(options = {})
  options = { state_file_name: STATE_FILE_NAME }.merge(options)
  super(options)
  fail "Unexpected mode: #{config.mode}" unless config.mode == :playback
end

Instance Method Details

#handle_request(env, verb, uri, headers, body) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/right_develop/testing/servers/might_api/app/playback.rb', line 38

def handle_request(env, verb, uri, headers, body)
  proxy(
    ::RightDevelop::Testing::Client::Rest::Request::Playback,
    verb,
    uri,
    headers,
    body,
    config.throttle)
end