Class: SearchApi::ErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/searchapi/error_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_descriptionObject (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_typeObject (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

Returns:

  • (Boolean)


13
14
15
# File 'lib/searchapi/error_result.rb', line 13

def success?
  false
end