Class: Polar::Authentication::AuthFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/polar/authentication.rb

Overview

Factory for creating appropriate authentication based on token type

Class Method Summary collapse

Class Method Details

.create(token) ⇒ Object



72
73
74
75
76
77
78
79
80
# File 'lib/polar/authentication.rb', line 72

def self.create(token)
  return nil if token.nil? || token.empty?

  if token.start_with?('polar_oat_')
    OATAuth.new(token)
  else
    CustomerAuth.new(token)
  end
end