Class: Plaid::Risk
- Inherits:
-
Object
- Object
- Plaid::Risk
- Defined in:
- lib/plaid/risk.rb
Overview
Public: Representation of risk data (per account).
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Public: The Hash with Symbol reasons and associated Float subscores contributing to the overall risk score.
-
#score ⇒ Object
readonly
Public: The Float comprehensive risk score associated with the account, where 0 is the lowest risk and 1 is the highest.
Instance Method Summary collapse
-
#initialize(fields) ⇒ Risk
constructor
Internal: Construct a Risk object.
-
#inspect ⇒ Object
(also: #to_s)
Public: Get a String representation of Risk.
Constructor Details
#initialize(fields) ⇒ Risk
Internal: Construct a Risk object.
fields - The Hash with fields.
17 18 19 20 |
# File 'lib/plaid/risk.rb', line 17 def initialize(fields) @score = fields['score'] @reason = Plaid.symbolize_hash(fields['reason']) end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Public: The Hash with Symbol reasons and associated Float subscores contributing to the overall risk score.
E.g. { transaction_amounts: 0.78, foreign_fees: 0.96, … }.
12 13 14 |
# File 'lib/plaid/risk.rb', line 12 def reason @reason end |
#score ⇒ Object (readonly)
Public: The Float comprehensive risk score associated with the account, where 0 is the lowest risk and 1 is the highest. E.g. 0.5.
6 7 8 |
# File 'lib/plaid/risk.rb', line 6 def score @score end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
Public: Get a String representation of Risk.
Returns a String.
25 26 27 |
# File 'lib/plaid/risk.rb', line 25 def inspect "#<Plaid::Risk score=#{score.inspect}, ..." end |