Class: ThePlaidApi::SignalEvaluateDevice
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::SignalEvaluateDevice
- Defined in:
- lib/the_plaid_api/models/signal_evaluate_device.rb
Overview
Details about the end user’s device. These fields are optional, but strongly recommended to increase the accuracy of results when using Signal Transaction Scores. When using a Balance-only Ruleset, these fields are ignored if the Signal Addendum has been signed; if it has not been signed, using these fields will result in an error.
Instance Attribute Summary collapse
-
#ip_address ⇒ String
The IP address of the device that initiated the transaction.
-
#user_agent ⇒ String
The user agent of the device that initiated the transaction (e.g. “Mozilla/5.0”).
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(ip_address: SKIP, user_agent: SKIP, additional_properties: nil) ⇒ SignalEvaluateDevice
constructor
A new instance of SignalEvaluateDevice.
-
#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(ip_address: SKIP, user_agent: SKIP, additional_properties: nil) ⇒ SignalEvaluateDevice
Returns a new instance of SignalEvaluateDevice.
49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 49 def initialize(ip_address: SKIP, user_agent: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @ip_address = ip_address unless ip_address == SKIP @user_agent = user_agent unless user_agent == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#ip_address ⇒ String
The IP address of the device that initiated the transaction
18 19 20 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 18 def ip_address @ip_address end |
#user_agent ⇒ String
The user agent of the device that initiated the transaction (e.g. “Mozilla/5.0”)
23 24 25 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 23 def user_agent @user_agent end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ip_address = hash.key?('ip_address') ? hash['ip_address'] : SKIP user_agent = hash.key?('user_agent') ? hash['user_agent'] : SKIP # 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. SignalEvaluateDevice.new(ip_address: ip_address, user_agent: user_agent, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['ip_address'] = 'ip_address' @_hash['user_agent'] = 'user_agent' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 45 46 47 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 42 def self.nullables %w[ ip_address user_agent ] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 34 def self.optionals %w[ ip_address user_agent ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
88 89 90 91 92 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 88 def inspect class_name = self.class.name.split('::').last "<#{class_name} ip_address: #{@ip_address.inspect}, user_agent: #{@user_agent.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 85 |
# File 'lib/the_plaid_api/models/signal_evaluate_device.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} ip_address: #{@ip_address}, user_agent: #{@user_agent},"\ " additional_properties: #{@additional_properties}>" end |