Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::ItemsTaxonomy404ErrorException

Inherits:
APIException
  • Object
show all
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_taxonomy404_error_exception.rb

Overview

Items Taxonomy 404 Error class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ ItemsTaxonomy404ErrorException

The constructor.

Parameters:

  • reason (String)

    The reason for raising an exception.

  • response (HttpResponse)

    The HttpReponse of the API call.



20
21
22
23
24
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_taxonomy404_error_exception.rb', line 20

def initialize(reason, response)
  super(reason, response)
  hash = APIHelper.json_deserialize(@response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#errorArray[Error3]

TODO: Write general description for this method

Returns:



15
16
17
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_taxonomy404_error_exception.rb', line 15

def error
  @error
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



51
52
53
54
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_taxonomy404_error_exception.rb', line 51

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} error: #{@error.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



45
46
47
48
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_taxonomy404_error_exception.rb', line 45

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} error: #{@error}>"
end

#unbox(hash) ⇒ Object

Populates this object by extracting properties from a hash. response body.

Parameters:

  • hash (Hash)

    The deserialized response sent by the server in the



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_taxonomy404_error_exception.rb', line 29

def unbox(hash)
  return nil unless hash

  # Parameter is an array, so we need to iterate through it
  @error = nil
  unless hash['error'].nil?
    @error = []
    hash['error'].each do |structure|
      @error << (Error3.from_hash(structure) if structure)
    end
  end

  @error = nil unless hash.key?('error')
end