Class: PaypalServerSdk::PhoneNumber
- Defined in:
- lib/paypal_server_sdk/models/phone_number.rb
Overview
The phone number in its canonical international E.164 numbering plan format., The phone number, in its canonical international E.164 numbering plan format.
Instance Attribute Summary collapse
-
#national_number ⇒ String
The national number, in its canonical international E.164 numbering plan format.
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(national_number:) ⇒ PhoneNumber
constructor
A new instance of PhoneNumber.
-
#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(national_number:) ⇒ PhoneNumber
Returns a new instance of PhoneNumber.
40 41 42 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 40 def initialize(national_number:) @national_number = national_number end |
Instance Attribute Details
#national_number ⇒ String
The national number, in its canonical international E.164 numbering plan format. 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).
21 22 23 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 21 def national_number @national_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 45 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. national_number = hash.key?('national_number') ? hash['national_number'] : nil # Create object from extracted values. PhoneNumber.new(national_number: national_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['national_number'] = 'national_number' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
31 32 33 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 31 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
63 64 65 66 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 63 def inspect class_name = self.class.name.split('::').last "<#{class_name} national_number: #{@national_number.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
57 58 59 60 |
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 57 def to_s class_name = self.class.name.split('::').last "<#{class_name} national_number: #{@national_number}>" end |