Class: SlowServer::ServerConfig

Inherits:
Config
  • Object
show all
Defined in:
lib/slow_server/config.rb

Instance Attribute Summary collapse

Attributes inherited from Config

#chunk_delay, #chunks, #port, #response_delay

Instance Method Summary collapse

Methods inherited from Config

#args, #opts

Constructor Details

#initializeServerConfig

Returns a new instance of ServerConfig.



35
36
37
38
# File 'lib/slow_server/config.rb', line 35

def initialize
  super
  self.response_body = File.read(File.expand_path("../../../files/response.txt", __FILE__))
end

Instance Attribute Details

#response_bodyObject

Returns the value of attribute response_body.



33
34
35
# File 'lib/slow_server/config.rb', line 33

def response_body
  @response_body
end

Instance Method Details

#parseObject



40
41
42
43
# File 'lib/slow_server/config.rb', line 40

def parse
  response = args.join(" ")
  self.response_body = response unless response.empty?
end