Class: ConnectionTester::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

Returns a new instance of Result.


257
258
259
# File 'lib/connection_tester.rb', line 257

def initialize
  self.rt = -1
end

Instance Attribute Details

#errorException

Returns if the test is unsuccessful, this will contain an exception of type Failure.

Returns:

  • (Exception)

    if the test is unsuccessful, this will contain an exception of type Failure


257
258
259
# File 'lib/connection_tester.rb', line 257

def error
  @error
end

#ipString

Returns resolved IP address from DNS query.

Returns:

  • (String)

    resolved IP address from DNS query


235
236
237
# File 'lib/connection_tester.rb', line 235

def ip
  @ip
end

#reachableBoolean

Returns whether the host was reachable over the network.

Returns:

  • (Boolean)

    whether the host was reachable over the network


238
239
240
# File 'lib/connection_tester.rb', line 238

def reachable
  @reachable
end

#rtInteger

Returns response time for the HTTP request.

Returns:

  • (Integer)

    response time for the HTTP request


247
248
249
# File 'lib/connection_tester.rb', line 247

def rt
  @rt
end

#software_versionString

Returns version of diaspora* as reported by nodeinfo.

Returns:

  • (String)

    version of diaspora* as reported by nodeinfo


250
251
252
# File 'lib/connection_tester.rb', line 250

def software_version
  @software_version
end

#sslBoolean

Returns whether the host has working ssl.

Returns:

  • (Boolean)

    whether the host has working ssl


241
242
243
# File 'lib/connection_tester.rb', line 241

def ssl
  @ssl
end

#status_codeInteger

Returns HTTP status code that was returned for the HEAD request.

Returns:

  • (Integer)

    HTTP status code that was returned for the HEAD request


244
245
246
# File 'lib/connection_tester.rb', line 244

def status_code
  @status_code
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)

265
266
267
# File 'lib/connection_tester.rb', line 265

def error?
  !error.nil?
end

#failure_messageObject


269
270
271
# File 'lib/connection_tester.rb', line 269

def failure_message
  "#{error.class.name}: #{error.message}" if error?
end

#success?Boolean

Returns:

  • (Boolean)

261
262
263
# File 'lib/connection_tester.rb', line 261

def success?
  error.nil?
end