Class: Nmap::Uptime

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

Overview

Wraps a uptime XML element.

Since:

  • 0.7.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



7
8
9
# File 'lib/nmap/uptime.rb', line 7

def last_boot
  @last_boot
end

#secondsObject

Returns the value of attribute seconds

Returns:

  • (Object)

    the current value of seconds



7
8
9
# File 'lib/nmap/uptime.rb', line 7

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:

  • 0.7.0



15
16
17
# File 'lib/nmap/uptime.rb', line 15

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