Class: Verizon::M5gBiAddress

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/m_5g_bi_address.rb

Overview

M5gBiAddress Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(address_line1 = SKIP, city = SKIP, state = SKIP, zip = SKIP, zip_4 = SKIP, phone = SKIP, phone_type = SKIP, email_address = SKIP) ⇒ M5gBiAddress

Returns a new instance of M5gBiAddress.



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/verizon/models/m_5g_bi_address.rb', line 77

def initialize(address_line1 = SKIP, city = SKIP, state = SKIP, zip = SKIP,
               zip_4 = SKIP, phone = SKIP, phone_type = SKIP,
               email_address = SKIP)
  @address_line1 = address_line1 unless address_line1 == SKIP
  @city = city unless city == SKIP
  @state = state unless state == SKIP
  @zip = zip unless zip == SKIP
  @zip_4 = zip_4 unless zip_4 == SKIP
  @phone = phone unless phone == SKIP
  @phone_type = phone_type unless phone_type == SKIP
  @email_address = email_address unless email_address == SKIP
end

Instance Attribute Details

#address_line1String

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/m_5g_bi_address.rb', line 14

def address_line1
  @address_line1
end

#cityString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/m_5g_bi_address.rb', line 18

def city
  @city
end

#email_addressString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/verizon/models/m_5g_bi_address.rb', line 42

def email_address
  @email_address
end

#phoneString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/verizon/models/m_5g_bi_address.rb', line 34

def phone
  @phone
end

#phone_typeString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/verizon/models/m_5g_bi_address.rb', line 38

def phone_type
  @phone_type
end

#stateString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/verizon/models/m_5g_bi_address.rb', line 22

def state
  @state
end

#zipString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/m_5g_bi_address.rb', line 26

def zip
  @zip
end

#zip_4String

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/verizon/models/m_5g_bi_address.rb', line 30

def zip_4
  @zip_4
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/verizon/models/m_5g_bi_address.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address_line1 = hash.key?('addressLine1') ? hash['addressLine1'] : SKIP
  city = hash.key?('city') ? hash['city'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  zip = hash.key?('zip') ? hash['zip'] : SKIP
  zip_4 = hash.key?('zip+4') ? hash['zip+4'] : SKIP
  phone = hash.key?('phone') ? hash['phone'] : SKIP
  phone_type = hash.key?('phoneType') ? hash['phoneType'] : SKIP
  email_address = hash.key?('emailAddress') ? hash['emailAddress'] : SKIP

  # Create object from extracted values.
  M5gBiAddress.new(address_line1,
                   city,
                   state,
                   zip,
                   zip_4,
                   phone,
                   phone_type,
                   email_address)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/verizon/models/m_5g_bi_address.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address_line1'] = 'addressLine1'
  @_hash['city'] = 'city'
  @_hash['state'] = 'state'
  @_hash['zip'] = 'zip'
  @_hash['zip_4'] = 'zip+4'
  @_hash['phone'] = 'phone'
  @_hash['phone_type'] = 'phoneType'
  @_hash['email_address'] = 'emailAddress'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/verizon/models/m_5g_bi_address.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/verizon/models/m_5g_bi_address.rb', line 59

def self.optionals
  %w[
    address_line1
    city
    state
    zip
    zip_4
    phone
    phone_type
    email_address
  ]
end