Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Cause
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Cause
- Defined in:
- lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb
Overview
Cause Model.
Instance Attribute Summary collapse
-
#code ⇒ String
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#field ⇒ String
TODO: Write general description for this method.
-
#type ⇒ 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, type = nil, description = nil) ⇒ Cause
constructor
A new instance of Cause.
-
#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, type = nil, description = nil) ⇒ Cause
Returns a new instance of Cause.
49 50 51 52 53 54 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb', line 49 def initialize(code = nil, field = nil, type = nil, description = nil) @code = code @field = field @type = type @description = description end |
Instance Attribute Details
#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/cause.rb', line 15 def code @code end |
#description ⇒ 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/cause.rb', line 27 def description @description 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/cause.rb', line 19 def field @field end |
#type ⇒ 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/cause.rb', line 23 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb', line 57 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 type = hash.key?('type') ? hash['type'] : nil description = hash.key?('description') ? hash['description'] : nil # Create object from extracted values. Cause.new(code, field, type, description) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['field'] = 'field' @_hash['type'] = 'type' @_hash['description'] = 'description' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb', line 40 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
81 82 83 84 85 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb', line 81 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, field: #{@field.inspect}, type: #{@type.inspect},"\ " description: #{@description.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
74 75 76 77 78 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb', line 74 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, field: #{@field}, type: #{@type}, description:"\ " #{@description}>" end |