Class: ThePlaidApi::SignalUser
- Defined in:
- lib/the_plaid_api/models/signal_user.rb
Overview
Details about the end user initiating the transaction (i.e., the account holder). These fields are optional, but strongly recommended to increase the accuracy of results when using Signal Transaction Scores. When using a Balance-only ruleset, if the Signal Addendum has been signed, these fields are ignored; if the Addendum has not been signed, using these fields will result in an error.
Instance Attribute Summary collapse
-
#address ⇒ AddressData2
Data about the components comprising an address.
-
#email_address ⇒ String
The user’s email address.
-
#name ⇒ SignalPersonName
The user’s legal name.
-
#phone_number ⇒ String
The user’s phone number, in E.164 format: +countrycodenumber.
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(name: SKIP, phone_number: SKIP, email_address: SKIP, address: SKIP, additional_properties: nil) ⇒ SignalUser
constructor
A new instance of SignalUser.
-
#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(name: SKIP, phone_number: SKIP, email_address: SKIP, address: SKIP, additional_properties: nil) ⇒ SignalUser
Returns a new instance of SignalUser.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 64 def initialize(name: SKIP, phone_number: SKIP, email_address: SKIP, address: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name unless name == SKIP @phone_number = phone_number unless phone_number == SKIP @email_address = email_address unless email_address == SKIP @address = address unless address == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ AddressData2
Data about the components comprising an address.
32 33 34 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 32 def address @address end |
#email_address ⇒ String
The user’s email address.
28 29 30 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 28 def email_address @email_address end |
#name ⇒ SignalPersonName
The user’s legal name
19 20 21 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 19 def name @name end |
#phone_number ⇒ String
The user’s phone number, in E.164 format: {countrycode}{number}. For example: “14151234567”
24 25 26 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 24 def phone_number @phone_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = SignalPersonName.from_hash(hash['name']) if hash['name'] phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP email_address = hash.key?('email_address') ? hash['email_address'] : SKIP address = AddressData2.from_hash(hash['address']) if hash['address'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. SignalUser.new(name: name, phone_number: phone_number, email_address: email_address, address: address, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['phone_number'] = 'phone_number' @_hash['email_address'] = 'email_address' @_hash['address'] = 'address' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 58 59 60 61 62 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 55 def self.nullables %w[ name phone_number email_address address ] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 45 def self.optionals %w[ name phone_number email_address address ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 115 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, phone_number: #{@phone_number.inspect},"\ " email_address: #{@email_address.inspect}, address: #{@address.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/signal_user.rb', line 102 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, phone_number: #{@phone_number}, email_address:"\ " #{@email_address}, address: #{@address}, additional_properties:"\ " #{@additional_properties}>" end |