Exception: Beanstalk::UnexpectedResponse

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/beanstalk-client/errors.rb

Class Method Summary collapse

Class Method Details

.classify(word, message) ⇒ Object



31
32
33
34
35
36
# File 'lib/beanstalk-client/errors.rb', line 31

def self.classify(word, message)
  for clas in subclasses
    return clas.new(message) if clas::WORD == word
  end
  return new(message)
end

.inherited(subclass) ⇒ Object



27
28
29
# File 'lib/beanstalk-client/errors.rb', line 27

def self.inherited(subclass)
  subclasses << subclass
end

.subclassesObject



23
24
25
# File 'lib/beanstalk-client/errors.rb', line 23

def self.subclasses
  @classes ||= []
end