Class: Nmap::XML::Uptime

Inherits:
Struct
  • Object
show all
Defined in:
lib/nmap/xml/uptime.rb

Overview

Wraps a uptime XML element.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#last_bootObject

Returns the value of attribute last_boot

Returns:

  • (Object)

    the current value of last_boot



10
11
12
# File 'lib/nmap/xml/uptime.rb', line 10

def last_boot
  @last_boot
end

#secondsObject

Returns the value of attribute seconds

Returns:

  • (Object)

    the current value of seconds



10
11
12
# File 'lib/nmap/xml/uptime.rb', line 10

def seconds
  @seconds
end

Instance Method Details

#to_sString

Converts the uptime object to a String.

Returns:

  • (String)

    The String form of the Uptime.

Since:

  • 1.0.0



18
19
20
# File 'lib/nmap/xml/uptime.rb', line 18

def to_s
  "uptime: #{self.seconds} (#{self.last_boot})"
end