Class: ThePlaidApi::PrismExtend
- Defined in:
- lib/the_plaid_api/models/prism_extend.rb
Overview
The data from the CashScore® Extend product returned by Prism Data.
Instance Attribute Summary collapse
-
#error_reason ⇒ String
The error returned by Prism for this product.
-
#metadata ⇒ PrismCashScoreMetadata
An object containing metadata about the provided transactions.
-
#model_version ⇒ String
The version of Prism Data’s CashScore® Extend model used.
-
#reason_codes ⇒ Array[String]
The reasons for an individual having risk according to the CashScore® Extend score.
-
#score ⇒ Integer
The score returned by Prism Data.
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(model_version:, score:, reason_codes: SKIP, metadata: SKIP, error_reason: SKIP, additional_properties: nil) ⇒ PrismExtend
constructor
A new instance of PrismExtend.
-
#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(model_version:, score:, reason_codes: SKIP, metadata: SKIP, error_reason: SKIP, additional_properties: nil) ⇒ PrismExtend
Returns a new instance of PrismExtend.
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 61 def initialize(model_version:, score:, reason_codes: SKIP, metadata: SKIP, error_reason: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @model_version = model_version @score = score @reason_codes = reason_codes unless reason_codes == SKIP @metadata = unless == SKIP @error_reason = error_reason unless error_reason == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#error_reason ⇒ String
The error returned by Prism for this product.
32 33 34 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 32 def error_reason @error_reason end |
#metadata ⇒ PrismCashScoreMetadata
An object containing metadata about the provided transactions.
28 29 30 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 28 def @metadata end |
#model_version ⇒ String
The version of Prism Data’s CashScore® Extend model used.
14 15 16 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 14 def model_version @model_version end |
#reason_codes ⇒ Array[String]
The reasons for an individual having risk according to the CashScore®Extend score.
24 25 26 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 24 def reason_codes @reason_codes end |
#score ⇒ Integer
The score returned by Prism Data. Ranges from 1-999, with higher score indicating lower risk.
19 20 21 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 19 def score @score end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 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/prism_extend.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. model_version = hash.key?('model_version') ? hash['model_version'] : nil score = hash.key?('score') ? hash['score'] : nil reason_codes = hash.key?('reason_codes') ? hash['reason_codes'] : SKIP = PrismCashScoreMetadata.from_hash(hash['metadata']) if hash['metadata'] error_reason = hash.key?('error_reason') ? hash['error_reason'] : 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. PrismExtend.new(model_version: model_version, score: score, reason_codes: reason_codes, metadata: , error_reason: error_reason, 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 43 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['model_version'] = 'model_version' @_hash['score'] = 'score' @_hash['reason_codes'] = 'reason_codes' @_hash['metadata'] = 'metadata' @_hash['error_reason'] = 'error_reason' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 58 59 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 55 def self.nullables %w[ score ] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 |
# File 'lib/the_plaid_api/models/prism_extend.rb', line 46 def self.optionals %w[ reason_codes metadata error_reason ] 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/prism_extend.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} model_version: #{@model_version.inspect}, score: #{@score.inspect},"\ " reason_codes: #{@reason_codes.inspect}, metadata: #{@metadata.inspect}, error_reason:"\ " #{@error_reason.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/prism_extend.rb', line 102 def to_s class_name = self.class.name.split('::').last "<#{class_name} model_version: #{@model_version}, score: #{@score}, reason_codes:"\ " #{@reason_codes}, metadata: #{@metadata}, error_reason: #{@error_reason},"\ " additional_properties: #{@additional_properties}>" end |