Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Phone

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

Overview

Phone 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(id = nil, area_code = nil, extension = nil, complete_number = nil, type = nil, subscriber_number = nil, country_code = nil, phone_validity = nil) ⇒ Phone

Returns a new instance of Phone.



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

def initialize(id = nil, area_code = nil, extension = nil,
               complete_number = nil, type = nil, subscriber_number = nil,
               country_code = nil, phone_validity = nil)
  @id = id
  @area_code = area_code
  @extension = extension
  @complete_number = complete_number
  @type = type
  @subscriber_number = subscriber_number
  @country_code = country_code
  @phone_validity = phone_validity
end

Instance Attribute Details

#area_codeString

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

def area_code
  @area_code
end

#complete_numberString

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

def complete_number
  @complete_number
end

#country_codeString

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/phone.rb', line 39

def country_code
  @country_code
end

#extensionString

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

def extension
  @extension
end

#idString

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

def id
  @id
end

#phone_validityPhoneValidity

TODO: Write general description for this method

Returns:



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

def phone_validity
  @phone_validity
end

#subscriber_numberString

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/phone.rb', line 35

def subscriber_number
  @subscriber_number
end

#typeString

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

def type
  @type
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/phone.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  area_code = hash.key?('areaCode') ? hash['areaCode'] : nil
  extension = hash.key?('extension') ? hash['extension'] : nil
  complete_number =
    hash.key?('completeNumber') ? hash['completeNumber'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  subscriber_number =
    hash.key?('subscriberNumber') ? hash['subscriberNumber'] : nil
  country_code = hash.key?('countryCode') ? hash['countryCode'] : nil
  phone_validity = PhoneValidity.from_hash(hash['phoneValidity']) if hash['phoneValidity']

  # Create object from extracted values.
  Phone.new(id,
            area_code,
            extension,
            complete_number,
            type,
            subscriber_number,
            country_code,
            phone_validity)
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/phone.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['area_code'] = 'areaCode'
  @_hash['extension'] = 'extension'
  @_hash['complete_number'] = 'completeNumber'
  @_hash['type'] = 'type'
  @_hash['subscriber_number'] = 'subscriberNumber'
  @_hash['country_code'] = 'countryCode'
  @_hash['phone_validity'] = 'phoneValidity'
  @_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/phone.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/phone.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
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/phone.rb', line 119

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, area_code: #{@area_code.inspect}, extension:"\
  " #{@extension.inspect}, complete_number: #{@complete_number.inspect}, type:"\
  " #{@type.inspect}, subscriber_number: #{@subscriber_number.inspect}, country_code:"\
  " #{@country_code.inspect}, phone_validity: #{@phone_validity.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/phone.rb', line 110

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, area_code: #{@area_code}, extension: #{@extension},"\
  " complete_number: #{@complete_number}, type: #{@type}, subscriber_number:"\
  " #{@subscriber_number}, country_code: #{@country_code}, phone_validity:"\
  " #{@phone_validity}>"
end