Class: ThePlaidApi::NotificationCategory

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

Overview

Category of Notification

Constant Summary collapse

NOTIFICATION_CATEGORY =
[
  # TODO: Write general description for SECURITY
  SECURITY = 'SECURITY'.freeze,

  # TODO: Write general description for MAINTENANCE
  MAINTENANCE = 'MAINTENANCE'.freeze,

  # TODO: Write general description for FRAUD
  FRAUD = 'FRAUD'.freeze,

  # TODO: Write general description for CONSENT
  CONSENT = 'CONSENT'.freeze,

  # TODO: Write general description for NEW_DATA
  NEW_DATA = 'NEW_DATA'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = SECURITY) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/notification_category.rb', line 35

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

  str = value.to_s.strip

  case str.downcase
  when 'security' then SECURITY
  when 'maintenance' then MAINTENANCE
  when 'fraud' then FRAUD
  when 'consent' then CONSENT
  when 'new_data' then NEW_DATA
  when 'tokenized_account_number' then TOKENIZED_ACCOUNT_NUMBER
  else
    default_value
  end
end

.validate(value) ⇒ Object



29
30
31
32
33
# File 'lib/the_plaid_api/models/notification_category.rb', line 29

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

  NOTIFICATION_CATEGORY.include?(value)
end