Class: Amass::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/amass/address.rb

Overview

An address of a hostname.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip:, cidr:, asn:, desc:) ⇒ Address

Initializes the address.

Parameters:

  • ip (String)

    An IP v4 or v6 address.

  • cidr (String)

    The IP address in CIDR format.

  • asn (Integer)

    The ASN number for the IP address.

  • desc (String)

    A description of the IP address.



46
47
48
49
50
51
# File 'lib/amass/address.rb', line 46

def initialize(ip: , cidr: , asn: , desc: )
  @ip   = ip
  @cidr = cidr
  @asn  = asn
  @desc = desc
end

Instance Attribute Details

#asnInteger (readonly)

The ASN number.

Returns:

  • (Integer)


22
23
24
# File 'lib/amass/address.rb', line 22

def asn
  @asn
end

#cidrString (readonly)

The CIDR mask.

Returns:

  • (String)


17
18
19
# File 'lib/amass/address.rb', line 17

def cidr
  @cidr
end

#descString (readonly) Also known as: description

The description of the address.

Returns:

  • (String)


27
28
29
# File 'lib/amass/address.rb', line 27

def desc
  @desc
end

#ipString (readonly)

The IP v4 or v6 address.

Returns:

  • (String)


12
13
14
# File 'lib/amass/address.rb', line 12

def ip
  @ip
end

Instance Method Details

#to_sString

Converts the address to a String.

Returns:

  • (String)

    The IP address.



59
60
61
# File 'lib/amass/address.rb', line 59

def to_s
  @ip
end