Class: ThePlaidApi::BankTransferDirection1

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

Overview

Indicates the direction of the transfer: ‘outbound`: for API-initiated transfers `inbound`: for payments received by the FBO account.

Constant Summary collapse

BANK_TRANSFER_DIRECTION1 =
[
  # TODO: Write general description for INBOUND
  INBOUND = 'inbound'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = INBOUND) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'inbound' then INBOUND
  when 'outbound' then OUTBOUND
  else
    default_value
  end
end

.validate(value) ⇒ Object



18
19
20
21
22
# File 'lib/the_plaid_api/models/bank_transfer_direction1.rb', line 18

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

  BANK_TRANSFER_DIRECTION1.include?(value)
end