Class: ThePlaidApi::SignalEvaluateRuleset
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::SignalEvaluateRuleset
- Defined in:
- lib/the_plaid_api/models/signal_evaluate_ruleset.rb
Overview
Details about the transaction result after evaluation by the requested Ruleset. If a ‘ruleset_key` is not provided, for customers who began using Signal Transaction Scores before October 15, 2025, by default, this field will be omitted. To learn more, see [Signal Rules](plaid.com/docs/signal/signal-rules/).
Instance Attribute Summary collapse
-
#outcome ⇒ String
The evaluated outcome for this transaction.
-
#result ⇒ RuleResult
The result of the rule that was triggered for this transaction.
-
#ruleset_key ⇒ String
The key of the Ruleset used for this transaction.
-
#triggered_rule_details ⇒ RuleDetails
Rules are run in numerical order.
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(result:, ruleset_key: SKIP, triggered_rule_details: SKIP, outcome: SKIP, additional_properties: nil) ⇒ SignalEvaluateRuleset
constructor
A new instance of SignalEvaluateRuleset.
-
#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(result:, ruleset_key: SKIP, triggered_rule_details: SKIP, outcome: SKIP, additional_properties: nil) ⇒ SignalEvaluateRuleset
Returns a new instance of SignalEvaluateRuleset.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 64 def initialize(result:, ruleset_key: SKIP, triggered_rule_details: SKIP, outcome: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @ruleset_key = ruleset_key unless ruleset_key == SKIP @result = result @triggered_rule_details = triggered_rule_details unless triggered_rule_details == SKIP @outcome = outcome unless outcome == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#outcome ⇒ String
The evaluated outcome for this transaction. This field is deprecated, use ‘result` or `triggered_rule_details.custom_action_key` instead.
36 37 38 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 36 def outcome @outcome end |
#result ⇒ RuleResult
The result of the rule that was triggered for this transaction. ‘ACCEPT`: Accept the transaction for processing. `REROUTE`: Reroute the transaction to a different payment method, as this transaction is too risky. `REVIEW`: Review the transaction before proceeding.
26 27 28 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 26 def result @result end |
#ruleset_key ⇒ String
The key of the Ruleset used for this transaction.
18 19 20 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 18 def ruleset_key @ruleset_key end |
#triggered_rule_details ⇒ RuleDetails
Rules are run in numerical order. The first rule with a logic match is triggered. These are the details of that rule.
31 32 33 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 31 def triggered_rule_details @triggered_rule_details 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 100 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. result = hash.key?('result') ? hash['result'] : nil ruleset_key = hash.key?('ruleset_key') ? hash['ruleset_key'] : SKIP triggered_rule_details = RuleDetails.from_hash(hash['triggered_rule_details']) if hash['triggered_rule_details'] outcome = hash.key?('outcome') ? hash['outcome'] : 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. SignalEvaluateRuleset.new(result: result, ruleset_key: ruleset_key, triggered_rule_details: triggered_rule_details, outcome: outcome, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['ruleset_key'] = 'ruleset_key' @_hash['result'] = 'result' @_hash['triggered_rule_details'] = 'triggered_rule_details' @_hash['outcome'] = 'outcome' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 61 62 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 58 def self.nullables %w[ triggered_rule_details ] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 49 def self.optionals %w[ ruleset_key triggered_rule_details outcome ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 116 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} ruleset_key: #{@ruleset_key.inspect}, result: #{@result.inspect},"\ " triggered_rule_details: #{@triggered_rule_details.inspect}, outcome: #{@outcome.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 108 |
# File 'lib/the_plaid_api/models/signal_evaluate_ruleset.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} ruleset_key: #{@ruleset_key}, result: #{@result}, triggered_rule_details:"\ " #{@triggered_rule_details}, outcome: #{@outcome}, additional_properties:"\ " #{@additional_properties}>" end |