Exception: Libgss::ErrorResponse

Inherits:
Error
  • Object
show all
Defined in:
lib/libgss.rb

Direct Known Subclasses

InvalidResponse, ServerBlockError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, message) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



42
43
44
45
# File 'lib/libgss.rb', line 42

def initialize(status, message)
  @status = status
  super(message)
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



41
42
43
# File 'lib/libgss.rb', line 41

def status
  @status
end

Class Method Details

.build(res) ⇒ Object



34
35
36
37
38
# File 'lib/libgss.rb', line 34

def build(res)
  return nil if res.nil?
  klass = subclasses.detect{|k| k.respond_to?(:match?) && k.match?(res)} || self
  klass.new(res.status, res.content)
end

.inherited(klass) ⇒ Object



31
32
33
# File 'lib/libgss.rb', line 31

def inherited(klass)
  subclasses << klass
end

.subclassesObject



28
29
30
# File 'lib/libgss.rb', line 28

def subclasses
  @subclasses ||= []
end