Class: HttpStub::Configurer::Server::BufferedCommandProcessor
- Inherits:
-
Object
- Object
- HttpStub::Configurer::Server::BufferedCommandProcessor
- Defined in:
- lib/http_stub/configurer/server/buffered_command_processor.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(command_processor) ⇒ BufferedCommandProcessor
constructor
A new instance of BufferedCommandProcessor.
- #process(command) ⇒ Object
Constructor Details
#initialize(command_processor) ⇒ BufferedCommandProcessor
Returns a new instance of BufferedCommandProcessor.
7 8 9 10 |
# File 'lib/http_stub/configurer/server/buffered_command_processor.rb', line 7 def initialize(command_processor) @command_processor = command_processor @commands = [] end |
Instance Method Details
#flush ⇒ Object
16 17 18 |
# File 'lib/http_stub/configurer/server/buffered_command_processor.rb', line 16 def flush @commands.each { |command| @command_processor.process(command) } end |
#process(command) ⇒ Object
12 13 14 |
# File 'lib/http_stub/configurer/server/buffered_command_processor.rb', line 12 def process(command) @commands << command end |