Class: HttpStub::Configurer::Server::CommandProcessor
- Inherits:
-
Object
- Object
- HttpStub::Configurer::Server::CommandProcessor
- Defined in:
- lib/http_stub/configurer/server/command_processor.rb
Instance Method Summary collapse
-
#initialize(configuration) ⇒ CommandProcessor
constructor
A new instance of CommandProcessor.
- #process(command, http_options = {}) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ CommandProcessor
Returns a new instance of CommandProcessor.
7 8 9 |
# File 'lib/http_stub/configurer/server/command_processor.rb', line 7 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#process(command, http_options = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/http_stub/configurer/server/command_processor.rb', line 11 def process(command, ={}) response = send_command(command, ) raise "#{(command)}: #{response.code} #{response.}" unless response.code == "200" response rescue StandardError => err raise "#{(command)}: #{err}" end |