Class: ThePlaidApi::WebhookType

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

Overview

The webhook types that can be fired by this test endpoint.

Constant Summary collapse

WEBHOOK_TYPE =
[
  # TODO: Write general description for AUTH
  AUTH = 'AUTH'.freeze,

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = AUTH) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/the_plaid_api/models/webhook_type.rb', line 38

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

  str = value.to_s.strip

  case str.downcase
  when 'auth' then AUTH
  when 'holdings' then HOLDINGS
  when 'investments_transactions' then INVESTMENTS_TRANSACTIONS
  when 'item' then ITEM
  when 'liabilities' then LIABILITIES
  when 'transactions' then TRANSACTIONS
  when 'assets' then ASSETS
  else
    default_value
  end
end

.validate(value) ⇒ Object



32
33
34
35
36
# File 'lib/the_plaid_api/models/webhook_type.rb', line 32

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

  WEBHOOK_TYPE.include?(value)
end