Class: ThePlaidApi::LinkDeliverySessionStatus

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

Overview

The status of the given Hosted Link session. ‘CREATED`: The session is created but not yet accessed by the user `OPENED`: The session is opened by the user but not yet completed `EXITED`: The session has been exited by the user `COMPLETED`: The session has been completed by the user `EXPIRED`: The session has expired

Constant Summary collapse

[
  # TODO: Write general description for CREATED
  CREATED = 'CREATED'.freeze,

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CREATED) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/link_delivery_session_status.rb', line 36

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

  str = value.to_s.strip

  case str.downcase
  when 'created' then CREATED
  when 'opened' then OPENED
  when 'exited' then EXITED
  when 'completed' then COMPLETED
  when 'expired' then EXPIRED
  else
    default_value
  end
end

.validate(value) ⇒ Object



30
31
32
33
34
# File 'lib/the_plaid_api/models/link_delivery_session_status.rb', line 30

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

  LINK_DELIVERY_SESSION_STATUS.include?(value)
end