Class: Istat::Frames::RegisterResponse

Inherits:
Response show all
Defined in:
lib/istat/frames/register.rb

Constant Summary collapse

MACOSX =
1
OTHER_UNIX =
2

Constants inherited from Base

Base::DOCTYPE

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_s

Constructor Details

This class inherits a constructor from Istat::Frames::Base

Instance Method Details

#authorize?Boolean

check if the user has to authorize using password

Returns:

  • (Boolean)

    true if the user should authorize



37
38
39
# File 'lib/istat/frames/register.rb', line 37

def authorize?
  @root.attributes["ath"].to_i == 1
end

#last_uptimeInteger

calculate the uptime value

Returns:

  • (Integer)

    a timestamp (Time.now - val)



43
44
45
# File 'lib/istat/frames/register.rb', line 43

def last_uptime
  @root.attributes["n"].to_i
end

#macosx?Boolean

Returns true if the remote system is a mac os x.

Returns:

  • (Boolean)

    true if the remote system is a mac os x



70
71
72
# File 'lib/istat/frames/register.rb', line 70

def macosx?
  platform == MACOSX
end

#other_unix?Boolean

Returns true if the remote system is a unix (linux, freebsd, solaris).

Returns:

  • (Boolean)

    true if the remote system is a unix (linux, freebsd, solaris)



65
66
67
# File 'lib/istat/frames/register.rb', line 65

def other_unix?
  platform == OTHER_UNIX
end

#platformObject

parse the platform of the remote system

Returns:

  • static value 2



60
61
62
# File 'lib/istat/frames/register.rb', line 60

def platform
  @root.attributes["pl"].to_i
end

#ssObject

Returns static value 6.

Returns:

  • static value 6



54
55
56
# File 'lib/istat/frames/register.rb', line 54

def ss
  @root.attributes["ss"].to_i
end

#uptimeInteger

calculate the current uptime value

Returns:

  • (Integer)

    a timestamp (Time.now - val)



49
50
51
# File 'lib/istat/frames/register.rb', line 49

def uptime
  @root.attributes["c"].to_i
end