Class: HttpStub::Configurer::Server::BufferedCommandProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/http_stub/configurer/server/buffered_command_processor.rb

Instance Method Summary collapse

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

#flushObject



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