Class: PaypalServerSdk::PhoneNumberWithCountryCode
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::PhoneNumberWithCountryCode
- Defined in:
- lib/paypal_server_sdk/models/phone_number_with_country_code.rb
Overview
The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
Instance Attribute Summary collapse
-
#country_code ⇒ String
The country calling code (CC), in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
-
#national_number ⇒ String
The national number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
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(country_code:, national_number:) ⇒ PhoneNumberWithCountryCode
constructor
A new instance of PhoneNumberWithCountryCode.
Methods inherited from BaseModel
Constructor Details
#initialize(country_code:, national_number:) ⇒ PhoneNumberWithCountryCode
Returns a new instance of PhoneNumberWithCountryCode.
47 48 49 50 |
# File 'lib/paypal_server_sdk/models/phone_number_with_country_code.rb', line 47 def initialize(country_code:, national_number:) @country_code = country_code @national_number = national_number end |
Instance Attribute Details
#country_code ⇒ String
The country calling code (CC), in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en). The combined length of the CC and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).
19 20 21 |
# File 'lib/paypal_server_sdk/models/phone_number_with_country_code.rb', line 19 def country_code @country_code end |
#national_number ⇒ String
The national number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).
27 28 29 |
# File 'lib/paypal_server_sdk/models/phone_number_with_country_code.rb', line 27 def national_number @national_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/paypal_server_sdk/models/phone_number_with_country_code.rb', line 53 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country_code = hash.key?('country_code') ? hash['country_code'] : nil national_number = hash.key?('national_number') ? hash['national_number'] : nil # Create object from extracted values. PhoneNumberWithCountryCode.new(country_code: country_code, national_number: national_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 |
# File 'lib/paypal_server_sdk/models/phone_number_with_country_code.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['country_code'] = 'country_code' @_hash['national_number'] = 'national_number' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/paypal_server_sdk/models/phone_number_with_country_code.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
38 39 40 |
# File 'lib/paypal_server_sdk/models/phone_number_with_country_code.rb', line 38 def self.optionals [] end |