Class: UspsApi::SubscriptionsNcoaChangeOfAddressDetailFields2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::SubscriptionsNcoaChangeOfAddressDetailFields2
- Defined in:
- lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb
Overview
Name or Business Name pertaining to address.
Instance Attribute Summary collapse
-
#business_name ⇒ String
Business Name.
-
#first_name ⇒ String
First Name.
-
#last_name ⇒ String
Last Name.
-
#middle_inital ⇒ String
Middle Initial.
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.
Instance Method Summary collapse
-
#initialize(first_name: SKIP, middle_inital: SKIP, last_name: SKIP, business_name: SKIP) ⇒ SubscriptionsNcoaChangeOfAddressDetailFields2
constructor
A new instance of SubscriptionsNcoaChangeOfAddressDetailFields2.
-
#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(first_name: SKIP, middle_inital: SKIP, last_name: SKIP, business_name: SKIP) ⇒ SubscriptionsNcoaChangeOfAddressDetailFields2
Returns a new instance of SubscriptionsNcoaChangeOfAddressDetailFields2.
53 54 55 56 57 58 59 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 53 def initialize(first_name: SKIP, middle_inital: SKIP, last_name: SKIP, business_name: SKIP) @first_name = first_name unless first_name == SKIP @middle_inital = middle_inital unless middle_inital == SKIP @last_name = last_name unless last_name == SKIP @business_name = business_name unless business_name == SKIP end |
Instance Attribute Details
#business_name ⇒ String
Business Name.
26 27 28 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 26 def business_name @business_name end |
#first_name ⇒ String
First Name.
14 15 16 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 14 def first_name @first_name end |
#last_name ⇒ String
Last Name.
22 23 24 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 22 def last_name @last_name end |
#middle_inital ⇒ String
Middle Initial.
18 19 20 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 18 def middle_inital @middle_inital end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. first_name = hash.key?('firstName') ? hash['firstName'] : SKIP middle_inital = hash.key?('middleInital') ? hash['middleInital'] : SKIP last_name = hash.key?('lastName') ? hash['lastName'] : SKIP business_name = hash.key?('businessName') ? hash['businessName'] : SKIP # Create object from extracted values. SubscriptionsNcoaChangeOfAddressDetailFields2.new(first_name: first_name, middle_inital: middle_inital, last_name: last_name, business_name: business_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['first_name'] = 'firstName' @_hash['middle_inital'] = 'middleInital' @_hash['last_name'] = 'lastName' @_hash['business_name'] = 'businessName' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 39 def self.optionals %w[ first_name middle_inital last_name business_name ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 91 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} first_name: #{@first_name.inspect}, middle_inital:"\ " #{@middle_inital.inspect}, last_name: #{@last_name.inspect}, business_name:"\ " #{@business_name.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
79 80 81 82 83 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields2.rb', line 79 def to_s class_name = self.class.name.split('::').last "<#{class_name} first_name: #{@first_name}, middle_inital: #{@middle_inital}, last_name:"\ " #{@last_name}, business_name: #{@business_name}>" end |