Class: Sparkql::ErrorsProcessor
- Inherits:
-
Object
- Object
- Sparkql::ErrorsProcessor
- Defined in:
- lib/sparkql/errors.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
-
#dropped_errors? ⇒ Boolean
true if there is at least one :dropped error in the error stack.
-
#errors? ⇒ Boolean
true if the error stack contains at least one error.
-
#errors_by_status?(status) ⇒ Boolean
true if there is at least one error of status :status in the error stack.
-
#fatal_errors? ⇒ Boolean
true if there is at least one :fatal error in the error stack.
-
#initialize(errors = []) ⇒ ErrorsProcessor
constructor
A new instance of ErrorsProcessor.
-
#recovered_errors? ⇒ Boolean
true if there is at least one :recovered error in the error stack.
Constructor Details
#initialize(errors = []) ⇒ ErrorsProcessor
Returns a new instance of ErrorsProcessor.
5 6 7 |
# File 'lib/sparkql/errors.rb', line 5 def initialize(errors = []) @errors = Array(errors) end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
3 4 5 |
# File 'lib/sparkql/errors.rb', line 3 def errors @errors end |
Instance Method Details
#dropped_errors? ⇒ Boolean
true if there is at least one :dropped error in the error stack
28 29 30 |
# File 'lib/sparkql/errors.rb', line 28 def dropped_errors? errors_by_status? :dropped end |
#errors? ⇒ Boolean
true if the error stack contains at least one error
10 11 12 |
# File 'lib/sparkql/errors.rb', line 10 def errors? @errors.size.positive? end |
#errors_by_status?(status) ⇒ Boolean
true if there is at least one error of status :status in the error stack
15 16 17 18 19 20 |
# File 'lib/sparkql/errors.rb', line 15 def errors_by_status?(status) @errors.each do |error| return true if status == error.status end false end |
#fatal_errors? ⇒ Boolean
true if there is at least one :fatal error in the error stack
23 24 25 |
# File 'lib/sparkql/errors.rb', line 23 def fatal_errors? errors_by_status? :fatal end |
#recovered_errors? ⇒ Boolean
true if there is at least one :recovered error in the error stack
33 34 35 |
# File 'lib/sparkql/errors.rb', line 33 def recovered_errors? errors_by_status? :recovered end |