Class: Verizon::M5gBiAddress
- Defined in:
- lib/verizon/models/m_5g_bi_address.rb
Overview
M5gBiAddress Model.
Instance Attribute Summary collapse
-
#address_line1 ⇒ String
TODO: Write general description for this method.
-
#city ⇒ String
TODO: Write general description for this method.
-
#email_address ⇒ String
TODO: Write general description for this method.
-
#phone ⇒ String
TODO: Write general description for this method.
-
#phone_type ⇒ String
TODO: Write general description for this method.
-
#state ⇒ String
TODO: Write general description for this method.
-
#zip ⇒ String
TODO: Write general description for this method.
-
#zip_4 ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(address_line1 = SKIP, city = SKIP, state = SKIP, zip = SKIP, zip_4 = SKIP, phone = SKIP, phone_type = SKIP, email_address = SKIP) ⇒ M5gBiAddress
constructor
A new instance of M5gBiAddress.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #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_line1 ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 14 def address_line1 @address_line1 end |
#city ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 18 def city @city end |
#email_address ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 42 def email_address @email_address end |
#phone ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 34 def phone @phone end |
#phone_type ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 38 def phone_type @phone_type end |
#state ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 22 def state @state end |
#zip ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 26 def zip @zip end |
#zip_4 ⇒ String
TODO: Write general description for this method
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
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 |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
117 118 119 120 121 122 123 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 117 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 139 140 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} address_line1: #{@address_line1.inspect}, city: #{@city.inspect}, state:"\ " #{@state.inspect}, zip: #{@zip.inspect}, zip_4: #{@zip_4.inspect}, phone:"\ " #{@phone.inspect}, phone_type: #{@phone_type.inspect}, email_address:"\ " #{@email_address.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
126 127 128 129 130 131 |
# File 'lib/verizon/models/m_5g_bi_address.rb', line 126 def to_s class_name = self.class.name.split('::').last "<#{class_name} address_line1: #{@address_line1}, city: #{@city}, state: #{@state}, zip:"\ " #{@zip}, zip_4: #{@zip_4}, phone: #{@phone}, phone_type: #{@phone_type}, email_address:"\ " #{@email_address}>" end |