Class: Haipa::Client::TypedErrorInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/haipa_rest/typed_error_info.rb

Overview

Class which represents the error type and information.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#infoObject

Returns the error info parsed from the body of the http error response.

Returns:

  • (Object)

    the error info parsed from the body of the http error response.



15
16
17
# File 'lib/haipa_rest/typed_error_info.rb', line 15

def info
  @info
end

#typeString

Returns the error type parsed from the body of the http error response.

Returns:

  • (String)

    the error type parsed from the body of the http error response.



12
13
14
# File 'lib/haipa_rest/typed_error_info.rb', line 12

def type
  @type
end

Class Method Details

.deserialize_object(object) ⇒ TypedErrorInfo

Deserializes given hash into TypedErrorInfo object.

Parameters:

  • object (Hash)

    object to deserialize.

Returns:



22
23
24
25
26
27
28
29
30
31
# File 'lib/haipa_rest/typed_error_info.rb', line 22

def self.deserialize_object(object)
  return if object.nil?
  output_object = TypedErrorInfo.new

  output_object.type = object['type']

  output_object.info = object['info']

  output_object
end