Class: Ident::Response::ERROR

Inherits:
BasicResponse show all
Defined in:
lib/ident.rb

Overview

This class gives access to the error returned by an identd. It defines method for every possible kind of error: invalid_port? no_user? hidden_user? unknown_error?

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicResponse

#charset, #os, #userid

Constructor Details

#initialize(type) ⇒ ERROR

Returns a new instance of ERROR.



55
56
57
# File 'lib/ident.rb', line 55

def initialize(type)
  @type = type
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



54
55
56
# File 'lib/ident.rb', line 54

def type
  @type
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)

See Also:



60
# File 'lib/ident.rb', line 60

def error?; true; end

#hidden_user?Boolean

Does the identd hide information from us?

Returns:

  • (Boolean)


66
# File 'lib/ident.rb', line 66

def hidden_user?; @type == "HIDDEN-USER"; end

#invalid_port?Boolean

Did we specify an invalid port?

Returns:

  • (Boolean)


62
# File 'lib/ident.rb', line 62

def invalid_port?; @type == "INVALID-PORT"; end

#no_user?Boolean

Is no user known for the given connection specification?

Returns:

  • (Boolean)


64
# File 'lib/ident.rb', line 64

def no_user?; @type == "NO-USER"; end

#unknown_error?Boolean

Did an unknown error occur?

Returns:

  • (Boolean)


68
# File 'lib/ident.rb', line 68

def unknown_error?; @type == "UNKNOWN-ERROR"; end