Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Error
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Error
- Defined in:
- lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb
Overview
Error Model.
Instance Attribute Summary collapse
-
#category ⇒ String
TODO: Write general description for this method.
-
#causes ⇒ Array[Cause]
TODO: Write general description for this method.
-
#code ⇒ String
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#error_identifiers ⇒ ErrorIdentifiers
TODO: Write general description for this method.
-
#field ⇒ String
TODO: Write general description for this method.
-
#info ⇒ String
TODO: Write general description for this method.
-
#severity ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(code = nil, field = nil, description = nil, info = nil, severity = nil, category = nil, causes = nil, error_identifiers = nil) ⇒ Error
constructor
A new instance of Error.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(code = nil, field = nil, description = nil, info = nil, severity = nil, category = nil, causes = nil, error_identifiers = nil) ⇒ Error
Returns a new instance of Error.
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 69 def initialize(code = nil, field = nil, description = nil, info = nil, severity = nil, category = nil, causes = nil, error_identifiers = nil) @code = code @field = field @description = description @info = info @severity = severity @category = category @causes = causes @error_identifiers = error_identifiers end |
Instance Attribute Details
#category ⇒ String
TODO: Write general description for this method
35 36 37 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 35 def category @category end |
#causes ⇒ Array[Cause]
TODO: Write general description for this method
39 40 41 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 39 def causes @causes end |
#code ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 15 def code @code end |
#description ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 23 def description @description end |
#error_identifiers ⇒ ErrorIdentifiers
TODO: Write general description for this method
43 44 45 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 43 def error_identifiers @error_identifiers end |
#field ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 19 def field @field end |
#info ⇒ String
TODO: Write general description for this method
27 28 29 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 27 def info @info end |
#severity ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 31 def severity @severity end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash.key?('code') ? hash['code'] : nil field = hash.key?('field') ? hash['field'] : 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 # Parameter is an array, so we need to iterate through it causes = nil unless hash['causes'].nil? causes = [] hash['causes'].each do |structure| causes << (Cause.from_hash(structure) if structure) end end causes = nil unless hash.key?('causes') error_identifiers = ErrorIdentifiers.from_hash(hash['errorIdentifiers']) if hash['errorIdentifiers'] # Create object from extracted values. Error.new(code, field, description, info, severity, category, causes, error_identifiers) end |
.names ⇒ Object
A mapping from model property names to API property names.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['field'] = 'field' @_hash['description'] = 'description' @_hash['info'] = 'info' @_hash['severity'] = 'severity' @_hash['category'] = 'category' @_hash['causes'] = 'causes' @_hash['error_identifiers'] = 'errorIdentifiers' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 60 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
126 127 128 129 130 131 132 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 126 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, field: #{@field.inspect}, description:"\ " #{@description.inspect}, info: #{@info.inspect}, severity: #{@severity.inspect}, category:"\ " #{@category.inspect}, causes: #{@causes.inspect}, error_identifiers:"\ " #{@error_identifiers.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
118 119 120 121 122 123 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/error.rb', line 118 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, field: #{@field}, description: #{@description}, info:"\ " #{@info}, severity: #{@severity}, category: #{@category}, causes: #{@causes},"\ " error_identifiers: #{@error_identifiers}>" end |