Class: ThePlaidApi::SweepTrigger

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

Overview

The trigger of the sweep ‘“manual”` - The sweep is created manually by the customer `“incoming”` - The sweep is created by incoming funds flow (e.g. Incoming Wire) `“balance_threshold”` - The sweep is created by balance threshold setting `“automatic_aggregate”` - The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance.

Constant Summary collapse

SWEEP_TRIGGER =
[
  # TODO: Write general description for MANUAL
  MANUAL = 'manual'.freeze,

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = MANUAL) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'manual' then MANUAL
  when 'incoming' then INCOMING
  when 'balance_threshold' then BALANCE_THRESHOLD
  when 'automatic_aggregate' then AUTOMATIC_AGGREGATE
  else
    default_value
  end
end

.validate(value) ⇒ Object



28
29
30
31
32
# File 'lib/the_plaid_api/models/sweep_trigger.rb', line 28

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

  SWEEP_TRIGGER.include?(value)
end