Class: ThePlaidApi::TransferBalanceType

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

Overview

The type of balance. ‘prefunded_rtp_credits` - Your prefunded RTP credit balance with Plaid `prefunded_ach_credits` - Your prefunded ACH credit balance with Plaid

Constant Summary collapse

TRANSFER_BALANCE_TYPE =
[
  # TODO: Write general description for PREFUNDED_RTP_CREDITS
  PREFUNDED_RTP_CREDITS = 'prefunded_rtp_credits'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = PREFUNDED_RTP_CREDITS) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'prefunded_rtp_credits' then PREFUNDED_RTP_CREDITS
  when 'prefunded_ach_credits' then PREFUNDED_ACH_CREDITS
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  TRANSFER_BALANCE_TYPE.include?(value)
end