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.
6 7 8 |
# File 'lib/sparkql/errors.rb', line 6 def initialize( errors = [] ) @errors = Array(errors) end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/sparkql/errors.rb', line 4 def errors @errors end |
Instance Method Details
#dropped_errors? ⇒ Boolean
true if there is at least one :dropped error in the error stack
29 30 31 |
# File 'lib/sparkql/errors.rb', line 29 def dropped_errors? errors_by_status? :dropped end |
#errors? ⇒ Boolean
true if the error stack contains at least one error
11 12 13 |
# File 'lib/sparkql/errors.rb', line 11 def errors? @errors.size > 0 end |
#errors_by_status?(status) ⇒ Boolean
true if there is at least one error of status :status in the error stack
16 17 18 19 20 21 |
# File 'lib/sparkql/errors.rb', line 16 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
24 25 26 |
# File 'lib/sparkql/errors.rb', line 24 def fatal_errors? errors_by_status? :fatal end |
#recovered_errors? ⇒ Boolean
true if there is at least one :recovered error in the error stack
34 35 36 |
# File 'lib/sparkql/errors.rb', line 34 def recovered_errors? errors_by_status? :recovered end |