Class: ThePlaidApi::NotificationPayloadIdType

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

Overview

Type of entity causing origination of a notification

Constant Summary collapse

NOTIFICATION_PAYLOAD_ID_TYPE =
[
  # TODO: Write general description for ACCOUNT
  ACCOUNT = 'ACCOUNT'.freeze,

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACCOUNT) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/notification_payload_id_type.rb', line 32

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

  str = value.to_s.strip

  case str.downcase
  when 'account' then ACCOUNT
  when 'customer' then CUSTOMER
  when 'party' then PARTY
  when 'maintenance' then MAINTENANCE
  when 'consent' then CONSENT
  else
    default_value
  end
end

.validate(value) ⇒ Object



26
27
28
29
30
# File 'lib/the_plaid_api/models/notification_payload_id_type.rb', line 26

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

  NOTIFICATION_PAYLOAD_ID_TYPE.include?(value)
end