Class: ThePlaidApi::ProtectReportConfidence

Inherits:
Object
  • Object
show all
Defined in:
lib/the_plaid_api/models/protect_report_confidence.rb

Overview

The confidence level of the incident report. ‘CONFIRMED` indicates the incident has been verified and definitively occurred. `SUSPECTED` indicates the incident is believed to have occurred but has not been fully verified.

Constant Summary collapse

PROTECT_REPORT_CONFIDENCE =
[
  # TODO: Write general description for CONFIRMED
  CONFIRMED = 'CONFIRMED'.freeze,

  # TODO: Write general description for SUSPECTED
  SUSPECTED = 'SUSPECTED'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CONFIRMED) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/the_plaid_api/models/protect_report_confidence.rb', line 25

def self.from_value(value, default_value = CONFIRMED)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'confirmed' then CONFIRMED
  when 'suspected' then SUSPECTED
  else
    default_value
  end
end

.validate(value) ⇒ Object



19
20
21
22
23
# File 'lib/the_plaid_api/models/protect_report_confidence.rb', line 19

def self.validate(value)
  return false if value.nil?

  PROTECT_REPORT_CONFIDENCE.include?(value)
end