Class: ThePlaidApi::UpdateType

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

Overview

Indicates whether an Item requires user interaction to be updated, which can be the case for Items with some forms of two-factor authentication. ‘background` - Item can be updated in the background `user_present_required`

  • Item requires user interaction to be updated

Constant Summary collapse

UPDATE_TYPE =
[
  # TODO: Write general description for BACKGROUND
  BACKGROUND = 'background'.freeze,

  # TODO: Write general description for USER_PRESENT_REQUIRED
  USER_PRESENT_REQUIRED = 'user_present_required'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BACKGROUND) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'background' then BACKGROUND
  when 'user_present_required' then USER_PRESENT_REQUIRED
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  UPDATE_TYPE.include?(value)
end