Class: Amass::Hostname

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

Overview

A hostname.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, domain: nil, addresses: [], tag: nil, sources: []) ⇒ Hostname

Initializes the hostname.

Parameters:

  • name (String)

    The hostname.

  • domain (String, nil) (defaults to: nil)

    The domain the hostname belongs to.

  • addresses (Array<Address>) (defaults to: [])

    The addresses associated with the hostname.

  • tag (String, nil) (defaults to: nil)

    The amass tag.

  • sources (Array<String>) (defaults to: [])

    The source(s) that discovered the hostname.



54
55
56
57
58
59
60
# File 'lib/amass/hostname.rb', line 54

def initialize(name: , domain: nil, addresses: [], tag: nil, sources: [])
  @name      = name
  @domain    = domain
  @addresses = addresses
  @tag       = tag
  @sources   = sources
end

Instance Attribute Details

#addressesArray<Address> (readonly)

The addresses associated with the hostname.

Returns:



24
25
26
# File 'lib/amass/hostname.rb', line 24

def addresses
  @addresses
end

#domainString? (readonly)

The domain the hostname belongs to.

Returns:

  • (String, nil)


19
20
21
# File 'lib/amass/hostname.rb', line 19

def domain
  @domain
end

#nameString (readonly)

The hostname.

Returns:

  • (String)


14
15
16
# File 'lib/amass/hostname.rb', line 14

def name
  @name
end

#sourcesArray<String> (readonly)

The source(s) that discovered the hostname.

Returns:

  • (Array<String>)


34
35
36
# File 'lib/amass/hostname.rb', line 34

def sources
  @sources
end

#tagString? (readonly)

The tag from amass.

Returns:

  • (String, nil)


29
30
31
# File 'lib/amass/hostname.rb', line 29

def tag
  @tag
end

Instance Method Details

#to_sString

Converts the hostname to a String.

Returns:

  • (String)

    The hostname.



68
69
70
# File 'lib/amass/hostname.rb', line 68

def to_s
  @name
end