Class: SearchApi::ErrorResult
- Inherits:
-
Object
- Object
- SearchApi::ErrorResult
- Defined in:
- lib/searchapi/error_result.rb
Instance Attribute Summary collapse
-
#error_description ⇒ Object
readonly
Returns the value of attribute error_description.
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
Instance Method Summary collapse
-
#initialize(status_code, attributes = nil) ⇒ ErrorResult
constructor
A new instance of ErrorResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(status_code, attributes = nil) ⇒ ErrorResult
Returns a new instance of ErrorResult.
6 7 8 9 10 11 |
# File 'lib/searchapi/error_result.rb', line 6 def initialize( status_code, attributes = nil ) @error_type, @error_description = status_code_to_error( status_code ) if attributes&.respond_to?( :[] ) && attributes[ :error ] @error_description = attributes[ :error ] end end |
Instance Attribute Details
#error_description ⇒ Object (readonly)
Returns the value of attribute error_description.
4 5 6 |
# File 'lib/searchapi/error_result.rb', line 4 def error_description @error_description end |
#error_type ⇒ Object (readonly)
Returns the value of attribute error_type.
4 5 6 |
# File 'lib/searchapi/error_result.rb', line 4 def error_type @error_type end |
Instance Method Details
#success? ⇒ Boolean
13 14 15 |
# File 'lib/searchapi/error_result.rb', line 13 def success? false end |