Class: SidekiqRemappableErrors::ErrorMatcher
- Inherits:
-
Object
- Object
- SidekiqRemappableErrors::ErrorMatcher
- Defined in:
- lib/sidekiq_remappable_errors/error_matcher.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
Instance Method Summary collapse
-
#initialize(config) ⇒ ErrorMatcher
constructor
A new instance of ErrorMatcher.
- #match?(error) ⇒ Boolean
Constructor Details
#initialize(config) ⇒ ErrorMatcher
Returns a new instance of ErrorMatcher.
5 6 7 8 9 10 |
# File 'lib/sidekiq_remappable_errors/error_matcher.rb', line 5 def initialize(config) validate_config!(config) @klass = config[0] @regex = config[1] end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
12 13 14 |
# File 'lib/sidekiq_remappable_errors/error_matcher.rb', line 12 def klass @klass end |
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
12 13 14 |
# File 'lib/sidekiq_remappable_errors/error_matcher.rb', line 12 def regex @regex end |
Instance Method Details
#match?(error) ⇒ Boolean
14 15 16 |
# File 'lib/sidekiq_remappable_errors/error_matcher.rb', line 14 def match?(error) @klass.to_s == error.class.to_s && error..match(@regex) end |