Class: ThePlaidApi::SandboxTransferRfpSimulateAction

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

Overview

The action to simulate. Must be either ‘approve` or `reject`. - `approve`: Simulates bank approval, transitioning the transfer to `settled` status - `reject`: Simulates bank rejection, transitioning the transfer to `failed` status

Constant Summary collapse

SANDBOX_TRANSFER_RFP_SIMULATE_ACTION =
[
  # TODO: Write general description for APPROVE
  APPROVE = 'approve'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = APPROVE) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'approve' then APPROVE
  when 'reject' then REJECT
  else
    default_value
  end
end

.validate(value) ⇒ Object



20
21
22
23
24
# File 'lib/the_plaid_api/models/sandbox_transfer_rfp_simulate_action.rb', line 20

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

  SANDBOX_TRANSFER_RFP_SIMULATE_ACTION.include?(value)
end