Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::ItemsGroupsCount400ErrorException

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

Overview

Items Groups Count 400 Error class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ ItemsGroupsCount400ErrorException

The constructor.

Parameters:

  • reason (String)

    The reason for raising an exception.

  • response (HttpResponse)

    The HttpReponse of the API call.



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

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

Instance Attribute Details

#categoryString

TODO: Write general description for this method

Returns:

  • (String)


31
32
33
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 31

def category
  @category
end

#causesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


35
36
37
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 35

def causes
  @causes
end

#codeString

TODO: Write general description for this method

Returns:

  • (String)


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

def code
  @code
end

#descriptionString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 19

def description
  @description
end

#error_identifiersObject

TODO: Write general description for this method

Returns:

  • (Object)


39
40
41
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 39

def error_identifiers
  @error_identifiers
end

#infoString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 23

def info
  @info
end

#severityString

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 27

def severity
  @severity
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



75
76
77
78
79
80
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 75

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} code: #{@code.inspect}, description: #{@description.inspect}, info:"\
  " #{@info.inspect}, severity: #{@severity.inspect}, category: #{@category.inspect}, causes:"\
  " #{@causes.inspect}, error_identifiers: #{@error_identifiers.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



67
68
69
70
71
72
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 67

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} code: #{@code}, description: #{@description}, info: #{@info}, severity:"\
  " #{@severity}, category: #{@category}, causes: #{@causes}, error_identifiers:"\
  " #{@error_identifiers}>"
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



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/exceptions/items_groups_count400_error_exception.rb', line 53

def unbox(hash)
  return nil unless hash

  @code = hash.key?('code') ? hash['code'] : nil
  @description = hash.key?('description') ? hash['description'] : nil
  @info = hash.key?('info') ? hash['info'] : nil
  @severity = hash.key?('severity') ? hash['severity'] : nil
  @category = hash.key?('category') ? hash['category'] : nil
  @causes = hash.key?('causes') ? hash['causes'] : nil
  @error_identifiers =
    hash.key?('errorIdentifiers') ? hash['errorIdentifiers'] : nil
end