Class: ThePlaidApi::TransferRecurringStatus

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

Overview

The status of the recurring transfer. ‘active`: The recurring transfer is currently active. `cancelled`: The recurring transfer was cancelled by the client or Plaid. `expired`: The recurring transfer has completed all originations according to its recurring schedule.

Constant Summary collapse

TRANSFER_RECURRING_STATUS =
[
  # TODO: Write general description for ACTIVE
  ACTIVE = 'active'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACTIVE) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/the_plaid_api/models/transfer_recurring_status.rb', line 29

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

  str = value.to_s.strip

  case str.downcase
  when 'active' then ACTIVE
  when 'cancelled' then CANCELLED
  when 'expired' then EXPIRED
  else
    default_value
  end
end

.validate(value) ⇒ Object



23
24
25
26
27
# File 'lib/the_plaid_api/models/transfer_recurring_status.rb', line 23

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

  TRANSFER_RECURRING_STATUS.include?(value)
end