summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-23 13:49:07 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-23 13:49:07 +0000
commitd8aa37614354b1638bd8c73a3d8104dfdf39c08e (patch)
tree74ca4824429d53bea6019707545949e1f57e7102 /lib/custodian
parente3550fc78d1ef666bfd909394b0a66cfd0ac4cb6 (diff)
Ensure we have a sane argument to our constructor.
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/util/ping.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/custodian/util/ping.rb b/lib/custodian/util/ping.rb
index 86fa2ab..9abc746 100644
--- a/lib/custodian/util/ping.rb
+++ b/lib/custodian/util/ping.rb
@@ -25,6 +25,10 @@ module Custodian
# Save the hostname away, resolve it if possible.
#
def initialize( hostname )
+
+ raise ArgumentError, "Hostname must not be nil" if ( hostname.nil? )
+ raise ArgumentError, "Hostname must be a String" unless hostname.kind_of?( String )
+
@hostname = hostname
@resolved = Custodian::Util::DNS.hostname_to_ip( hostname )
end