Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Name

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

Overview

Name 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(complete_name = nil, first_name = nil, middle_name = nil, last_name = nil, general_suffix = nil, maturity_suffix = nil, title_of_respect = nil, empty = nil) ⇒ Name

Returns a new instance of Name.



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/name.rb', line 69

def initialize(complete_name = nil, first_name = nil, middle_name = nil,
               last_name = nil, general_suffix = nil, maturity_suffix = nil,
               title_of_respect = nil, empty = nil)
  @complete_name = complete_name
  @first_name = first_name
  @middle_name = middle_name
  @last_name = last_name
  @general_suffix = general_suffix
  @maturity_suffix = maturity_suffix
  @title_of_respect = title_of_respect
  @empty = empty
end

Instance Attribute Details

#complete_nameString

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/name.rb', line 15

def complete_name
  @complete_name
end

#emptyString

TODO: Write general description for this method

Returns:

  • (String)


43
44
45
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 43

def empty
  @empty
end

#first_nameString

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

def first_name
  @first_name
end

#general_suffixString

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/models/name.rb', line 31

def general_suffix
  @general_suffix
end

#last_nameString

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

def last_name
  @last_name
end

#maturity_suffixString

TODO: Write general description for this method

Returns:

  • (String)


35
36
37
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 35

def maturity_suffix
  @maturity_suffix
end

#middle_nameString

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/name.rb', line 23

def middle_name
  @middle_name
end

#title_of_respectString

TODO: Write general description for this method

Returns:

  • (String)


39
40
41
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 39

def title_of_respect
  @title_of_respect
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
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  complete_name = hash.key?('completeName') ? hash['completeName'] : nil
  first_name = hash.key?('firstName') ? hash['firstName'] : nil
  middle_name = hash.key?('middleName') ? hash['middleName'] : nil
  last_name = hash.key?('lastName') ? hash['lastName'] : nil
  general_suffix = hash.key?('generalSuffix') ? hash['generalSuffix'] : nil
  maturity_suffix =
    hash.key?('maturitySuffix') ? hash['maturitySuffix'] : nil
  title_of_respect =
    hash.key?('titleOfRespect') ? hash['titleOfRespect'] : nil
  empty = hash.key?('empty') ? hash['empty'] : nil

  # Create object from extracted values.
  Name.new(complete_name,
           first_name,
           middle_name,
           last_name,
           general_suffix,
           maturity_suffix,
           title_of_respect,
           empty)
end

.namesObject

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/name.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['complete_name'] = 'completeName'
  @_hash['first_name'] = 'firstName'
  @_hash['middle_name'] = 'middleName'
  @_hash['last_name'] = 'lastName'
  @_hash['general_suffix'] = 'generalSuffix'
  @_hash['maturity_suffix'] = 'maturitySuffix'
  @_hash['title_of_respect'] = 'titleOfRespect'
  @_hash['empty'] = 'empty'
  @_hash
end

.nullablesObject

An array for nullable fields



65
66
67
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 65

def self.nullables
  []
end

.optionalsObject

An array for optional fields



60
61
62
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 60

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



119
120
121
122
123
124
125
126
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 119

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} complete_name: #{@complete_name.inspect}, first_name:"\
  " #{@first_name.inspect}, middle_name: #{@middle_name.inspect}, last_name:"\
  " #{@last_name.inspect}, general_suffix: #{@general_suffix.inspect}, maturity_suffix:"\
  " #{@maturity_suffix.inspect}, title_of_respect: #{@title_of_respect.inspect}, empty:"\
  " #{@empty.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



110
111
112
113
114
115
116
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/name.rb', line 110

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} complete_name: #{@complete_name}, first_name: #{@first_name}, middle_name:"\
  " #{@middle_name}, last_name: #{@last_name}, general_suffix: #{@general_suffix},"\
  " maturity_suffix: #{@maturity_suffix}, title_of_respect: #{@title_of_respect}, empty:"\
  " #{@empty}>"
end