Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Cause

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/models/cause.rb

Overview

Cause Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#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/models/cause.rb', line 15

def code
  @code
end

#descriptionString

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/models/cause.rb', line 27

def description
  @description
end

#fieldString

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/models/cause.rb', line 19

def field
  @field
end

#typeString

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/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

.namesObject

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

.nullablesObject

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

.optionalsObject

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

#inspectObject

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_sObject

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