Class: Nmap::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/nmap/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, reason) ⇒ Status

Creates a new Status object.

Parameters:

  • state (Symbol)

    The state of a host.

  • reason (String)

    The reason for the state.



19
20
21
22
# File 'lib/nmap/status.rb', line 19

def initialize(state,reason)
  @state = state
  @reason = reason
end

Instance Attribute Details

#reasonObject (readonly)

The reason for the state



8
9
10
# File 'lib/nmap/status.rb', line 8

def reason
  @reason
end

#stateObject (readonly)

The state of a host



5
6
7
# File 'lib/nmap/status.rb', line 5

def state
  @state
end

Instance Method Details

#to_sString

Converts the status to a String.

Returns:

  • (String)

    The state.



30
31
32
# File 'lib/nmap/status.rb', line 30

def to_s
  @state.to_s
end