Class: PaypalServerSdk::SubscriptionPayerName
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::SubscriptionPayerName
- Defined in:
- lib/paypal_server_sdk/models/subscription_payer_name.rb
Overview
The name of the party.
Instance Attribute Summary collapse
-
#full_name ⇒ String
When the party is a person, the party’s full name.
-
#given_name ⇒ String
When the party is a person, the party’s given, or first, name.
-
#middle_name ⇒ String
When the party is a person, the party’s middle name.
-
#prefix ⇒ String
The prefix, or title, to the party’s name.
-
#suffix ⇒ String
The suffix for the party’s name.
-
#surname ⇒ String
When the party is a person, the party’s surname or family name.
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(prefix: SKIP, given_name: SKIP, surname: SKIP, middle_name: SKIP, suffix: SKIP, full_name: SKIP) ⇒ SubscriptionPayerName
constructor
A new instance of SubscriptionPayerName.
-
#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(prefix: SKIP, given_name: SKIP, surname: SKIP, middle_name: SKIP, suffix: SKIP, full_name: SKIP) ⇒ SubscriptionPayerName
Returns a new instance of SubscriptionPayerName.
68 69 70 71 72 73 74 75 76 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 68 def initialize(prefix: SKIP, given_name: SKIP, surname: SKIP, middle_name: SKIP, suffix: SKIP, full_name: SKIP) @prefix = prefix unless prefix == SKIP @given_name = given_name unless given_name == SKIP @surname = surname unless surname == SKIP @middle_name = middle_name unless middle_name == SKIP @suffix = suffix unless suffix == SKIP @full_name = full_name unless full_name == SKIP end |
Instance Attribute Details
#full_name ⇒ String
When the party is a person, the party’s full name.
37 38 39 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 37 def full_name @full_name end |
#given_name ⇒ String
When the party is a person, the party’s given, or first, name.
18 19 20 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 18 def given_name @given_name end |
#middle_name ⇒ String
When the party is a person, the party’s middle name. Use also to store multiple middle names including the patronymic, or father’s, middle name.
29 30 31 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 29 def middle_name @middle_name end |
#prefix ⇒ String
The prefix, or title, to the party’s name.
14 15 16 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 14 def prefix @prefix end |
#suffix ⇒ String
The suffix for the party’s name.
33 34 35 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 33 def suffix @suffix end |
#surname ⇒ String
When the party is a person, the party’s surname or family name. Also known as the last name. Required when the party is a person. Use also to store multiple surnames including the matronymic, or mother’s, surname.
24 25 26 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 24 def surname @surname end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. prefix = hash.key?('prefix') ? hash['prefix'] : SKIP given_name = hash.key?('given_name') ? hash['given_name'] : SKIP surname = hash.key?('surname') ? hash['surname'] : SKIP middle_name = hash.key?('middle_name') ? hash['middle_name'] : SKIP suffix = hash.key?('suffix') ? hash['suffix'] : SKIP full_name = hash.key?('full_name') ? hash['full_name'] : SKIP # Create object from extracted values. SubscriptionPayerName.new(prefix: prefix, given_name: given_name, surname: surname, middle_name: middle_name, suffix: suffix, full_name: full_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['prefix'] = 'prefix' @_hash['given_name'] = 'given_name' @_hash['surname'] = 'surname' @_hash['middle_name'] = 'middle_name' @_hash['suffix'] = 'suffix' @_hash['full_name'] = 'full_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 52 def self.optionals %w[ prefix given_name surname middle_name suffix full_name ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
107 108 109 110 111 112 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 107 def inspect class_name = self.class.name.split('::').last "<#{class_name} prefix: #{@prefix.inspect}, given_name: #{@given_name.inspect}, surname:"\ " #{@surname.inspect}, middle_name: #{@middle_name.inspect}, suffix: #{@suffix.inspect},"\ " full_name: #{@full_name.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
100 101 102 103 104 |
# File 'lib/paypal_server_sdk/models/subscription_payer_name.rb', line 100 def to_s class_name = self.class.name.split('::').last "<#{class_name} prefix: #{@prefix}, given_name: #{@given_name}, surname: #{@surname},"\ " middle_name: #{@middle_name}, suffix: #{@suffix}, full_name: #{@full_name}>" end |