Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::PostalAddress

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

Overview

PostalAddress 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(address1 = nil, city = nil, country = nil, name = nil, postal_code = nil, state = nil, address2 = nil, address_type = nil) ⇒ PostalAddress

Returns a new instance of PostalAddress.



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

def initialize(address1 = nil, city = nil, country = nil, name = nil,
               postal_code = nil, state = nil, address2 = nil,
               address_type = nil)
  @address1 = address1
  @city = city
  @country = country
  @name = name
  @postal_code = postal_code
  @state = state
  @address2 = address2
  @address_type = address_type
end

Instance Attribute Details

#address1String

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

def address1
  @address1
end

#address2String

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

def address2
  @address2
end

#address_typeString

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/postal_address.rb', line 43

def address_type
  @address_type
end

#cityString

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

def city
  @city
end

#countryString

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

def country
  @country
end

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

def name
  @name
end

#postal_codeString

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

def postal_code
  @postal_code
end

#stateString

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

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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address1 = hash.key?('address1') ? hash['address1'] : nil
  city = hash.key?('city') ? hash['city'] : nil
  country = hash.key?('country') ? hash['country'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : nil
  state = hash.key?('state') ? hash['state'] : nil
  address2 = hash.key?('address2') ? hash['address2'] : nil
  address_type = hash.key?('addressType') ? hash['addressType'] : nil

  # Create object from extracted values.
  PostalAddress.new(address1,
                    city,
                    country,
                    name,
                    postal_code,
                    state,
                    address2,
                    address_type)
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/postal_address.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address1'] = 'address1'
  @_hash['city'] = 'city'
  @_hash['country'] = 'country'
  @_hash['name'] = 'name'
  @_hash['postal_code'] = 'postalCode'
  @_hash['state'] = 'state'
  @_hash['address2'] = 'address2'
  @_hash['address_type'] = 'addressType'
  @_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/postal_address.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/postal_address.rb', line 60

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



116
117
118
119
120
121
122
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/postal_address.rb', line 116

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} address1: #{@address1.inspect}, city: #{@city.inspect}, country:"\
  " #{@country.inspect}, name: #{@name.inspect}, postal_code: #{@postal_code.inspect}, state:"\
  " #{@state.inspect}, address2: #{@address2.inspect}, address_type:"\
  " #{@address_type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



108
109
110
111
112
113
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/postal_address.rb', line 108

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} address1: #{@address1}, city: #{@city}, country: #{@country}, name:"\
  " #{@name}, postal_code: #{@postal_code}, state: #{@state}, address2: #{@address2},"\
  " address_type: #{@address_type}>"
end