Class: Ronin::OpenPort

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Timestamps, Model
Defined in:
lib/ronin/open_port.rb

Overview

Represents a open port at a specified IP address.

Instance Method Summary collapse

Methods included from Model

included

Instance Method Details

#addressString

The IP Address of the open port.

Returns:

  • (String)

    The IP Address.

Since:

  • 1.0.0



68
69
70
# File 'lib/ronin/open_port.rb', line 68

def address
  self.ip_address.address
end

#numberInteger

The port number.

Returns:

  • (Integer)

    The port number.

Since:

  • 1.0.0



82
83
84
# File 'lib/ronin/open_port.rb', line 82

def number
  self.port.number
end

#to_iInteger

Converts the open port to an integer.

Returns:

  • (Integer)

    The port number.

Since:

  • 1.0.0



96
97
98
# File 'lib/ronin/open_port.rb', line 96

def to_i
  self.port.to_i
end

#to_sString

Converts the open port to a string.

Returns:

  • (String)

    The information of the open port.

Since:

  • 1.0.0



110
111
112
113
114
115
116
# File 'lib/ronin/open_port.rb', line 110

def to_s
  if self.service
    "#{self.port} (#{self.service})"
  else
    self.port.to_s
  end
end