lib/nmap/service.rb in ruby-nmap-0.8.0 vs lib/nmap/service.rb in ruby-nmap-0.9.0

- old
+ new

@@ -150,9 +150,21 @@ # def confidence @confidence ||= @node.get_attribute('conf').to_i end - alias to_s name + # + # Converts the service to a String. + # + # @return [String] + # String containing {#product} and {#version}, or {#name}. + # + def to_s + if (product && version) + "#{product} #{version}" + else + name + end + end end end