lib/nmap/address.rb in ruby-nmap-0.5.1 vs lib/nmap/address.rb in ruby-nmap-0.6.0
- old
+ new
@@ -1,35 +1,18 @@
module Nmap
- class Address
+ #
+ # Represents a IP or MAC address.
+ #
+ class Address < Struct.new(:type, :addr)
- # Type of the address
- attr_reader :type
-
- # Address
- attr_reader :addr
-
#
- # Creates a new Address object.
- #
- # @param [Symbol] type
- # The type of the address.
- #
- # @param [String] addr
- # The address.
- #
- def initialize(type,addr)
- @type = type
- @addr = addr
- end
-
- #
# Converts the address to a String.
#
# @return [String]
# The address.
#
def to_s
- @addr.to_s
+ self.addr.to_s
end
end
end