summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/tcp.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-21 23:34:23 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-21 23:34:23 +0000
commit0971310be8093ab53b430ac5a8c7217ba8bf76a9 (patch)
tree430e54909f8969f26670c7e8873696ae2666bd80 /lib/custodian/protocoltest/tcp.rb
parentb7608cc947bcca078644516a288a6bef67f7f09a (diff)
Serialize and cosntruct neatly
Diffstat (limited to 'lib/custodian/protocoltest/tcp.rb')
-rw-r--r--lib/custodian/protocoltest/tcp.rb18
1 files changed, 12 insertions, 6 deletions
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
@@ -17,6 +17,12 @@ class TCPTest < ProtocolTest
#
+ # The input line
+ #
+ attr_reader :line
+
+
+ #
# The host to test against.
#
attr_reader :host
@@ -44,6 +50,11 @@ class TCPTest < ProtocolTest
def initialize( line )
#
+ # Save the line
+ #
+ @line = line
+
+ #
# Save the host
#
@host = line.split( /\s+/)[0]
@@ -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