Module: TestServerModule
- Defined in:
- lib/wdd-ruby-ext/utils/test_server.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
58 59 60 |
# File 'lib/wdd-ruby-ext/utils/test_server.rb', line 58 def self.included(base) base.send(:include, HTTPHandler) unless base.include?( HTTPHandler ) end |
Instance Method Details
#post_init ⇒ Object
62 63 64 |
# File 'lib/wdd-ruby-ext/utils/test_server.rb', line 62 def post_init puts 'got connection' end |
#puts(string) ⇒ Object
78 79 80 |
# File 'lib/wdd-ruby-ext/utils/test_server.rb', line 78 def puts string TestServer.logger.debug( string ) end |
#receive_data(data) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/wdd-ruby-ext/utils/test_server.rb', line 66 def receive_data(data) puts "Got data:\n#{data}" if http_request = http_request?( data ) return_data = process_http_request( http_request ) else return_data = "Your request was processed by the TestServer." end send_data(return_data) puts "Sent: #{return_data}" close_connection_after_writing end |