Module: AboutYou::SDK::Model::ResultError

Included in:
BasketItem, BasketSet
Defined in:
lib/AboutYou/Model/result_error.rb

Overview

This class represents an result error model

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#error_codeObject

error code



11
12
13
# File 'lib/AboutYou/Model/result_error.rb', line 11

def error_code
  @error_code
end

#error_identObject

error ident



9
10
11
# File 'lib/AboutYou/Model/result_error.rb', line 9

def error_ident
  @error_ident
end

#error_messageObject

error message



13
14
15
# File 'lib/AboutYou/Model/result_error.rb', line 13

def error_message
  @error_message
end

Instance Method Details

#initialize(json_object) ⇒ Object

Constructor for the AboutYou::SDK::Model::ResultError class

  • Args :

    • json_object -> the json_object received from the api

  • Returns :

    • an instance of AboutYou::SDK::Model::ResultError



24
25
26
27
28
# File 'lib/AboutYou/Model/result_error.rb', line 24

def initialize(json_object)
  parse_error_result(json_object)

  self
end

#parse_error_result(json_object) ⇒ Object

This method parses the error result

  • Args :

    • json_object -> the json_object received from the api



36
37
38
39
40
# File 'lib/AboutYou/Model/result_error.rb', line 36

def parse_error_result(json_object)
  self.error_ident   = json_object.key?('error_ident') ? String(json_object['error_ident']) : nil
  self.error_code    = json_object.key?('error_code') ? Integer(json_object['error_code']) : 0
  self.error_message = json_object.key?('error_message') ? json_object['error_message'] : nil
end