From 31fdb85b20719eb2dab4d6e3cfea721e6c58ac08 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 21 Nov 2012 23:34:23 +0000 Subject: Serialize and cosntruct neatly --- lib/custodian/protocoltest/tcp.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/custodian/protocoltest/tcp.rb') diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb index 5f29b7f..9806565 100644 --- a/lib/custodian/protocoltest/tcp.rb +++ b/lib/custodian/protocoltest/tcp.rb @@ -16,6 +16,12 @@ require 'timeout' class TCPTest < ProtocolTest + # + # The input line + # + attr_reader :line + + # # The host to test against. # @@ -43,6 +49,11 @@ class TCPTest < ProtocolTest # def initialize( line ) + # + # Save the line + # + @line = line + # # Save the host # @@ -90,12 +101,7 @@ class TCPTest < ProtocolTest # Convert this class to JSON such that it may be serialized. # def to_json - hash = { - :test_type => 'tcp', - :test_target => @host, - :test_port => @port, - :banner => @banner - } + hash = { :line => @line } hash.to_json end -- cgit v1.2.1