Class: Bosh::Retryable::ErrorMatcher
- Inherits:
-
Object
- Object
- Bosh::Retryable::ErrorMatcher
- Defined in:
- lib/common/retryable.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(klass, message_regex) ⇒ ErrorMatcher
constructor
A new instance of ErrorMatcher.
- #matches?(error) ⇒ Boolean
Constructor Details
#initialize(klass, message_regex) ⇒ ErrorMatcher
Returns a new instance of ErrorMatcher.
86 87 88 89 |
# File 'lib/common/retryable.rb', line 86 def initialize(klass, ) @klass = klass @message_regex = end |
Class Method Details
.by_class(klass) ⇒ Object
82 83 84 |
# File 'lib/common/retryable.rb', line 82 def self.by_class(klass) new(klass, /.*/) end |
Instance Method Details
#matches?(error) ⇒ Boolean
91 92 93 |
# File 'lib/common/retryable.rb', line 91 def matches?(error) !!(error.kind_of?(@klass) && error. =~ @message_regex) end |