class Psychometric::Provider

# Provider

This is the standardized API that individual provider implementations must conform to. It abstracts the constructs from the provider into those used by Psychometric.

Public Class Methods

assessment(identity) click to toggle source
# File lib/psychometric/provider.rb, line 18
def self.assessment(identity)
  symbolized_identity = identity.inject({}) { |memo, (k,v)| memo[k.to_sym] = v; memo } # symbolize_keys
  raise Assessment::IdentityError unless symbolized_identity.keys.to_set == @@assessment_identifiers.to_set
  Assessment.new self, symbolized_identity
end
new(authentication) click to toggle source

raise NotImplementedError, 'Subclasses must define `resolved?`.'

# File lib/psychometric/provider.rb, line 13
def initialize(authentication)
  raise AuthenticationError unless authentication.keys.to_set == @@authentication_keys.to_set
  @authentication = authentication
end

Protected Class Methods

assessments_identified_with(*args) click to toggle source
# File lib/psychometric/provider.rb, line 30
def self.assessments_identified_with(*args)
  @@assessment_identifiers = args
end
authenticate_with(*args) click to toggle source
# File lib/psychometric/provider.rb, line 26
def self.authenticate_with(*args)
  @@authentication_keys = args
end