Sha256: d345b6da8cbee85c1d2cf0b312fb67a9f5368606aad01d54ea19cac8393748cc

Contents?: true

Size: 847 Bytes

Versions: 9

Compression:

Stored size: 847 Bytes

Contents

module Psychometric
  # # Assessment
  #
  # This represents the various assessments a Subject can undertake with a
  # Provider. Since different providers have different ways of identifying and
  # organizing their assessments, we give them a dynamic identity.
  class Assessment
    class IdentityError < StandardError
      def message
        'Incorrect or missing identity, check the Provider configuration'
      end
    end
    class ProviderError < StandardError
      def message
        'Assessment needs a subclass of Provider as the first argument for identity checking'
      end
    end

    attr_reader :identity

    def initialize(provider, identity = {})
      raise IdentityError if identity.empty?
      raise ProviderError unless provider.ancestors.include? Psychometric::Provider
      @identity = identity
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
psychometric-0.1.9 lib/psychometric/assessment.rb
psychometric-0.1.8 lib/psychometric/assessment.rb
psychometric-0.1.7 lib/psychometric/assessment.rb
psychometric-0.1.6 lib/psychometric/assessment.rb
psychometric-0.1.5 lib/psychometric/assessment.rb
psychometric-0.1.3 lib/psychometric/assessment.rb
psychometric-0.1.2 lib/psychometric/assessment.rb
psychometric-0.1.1 lib/psychometric/assessment.rb
psychometric-0.1.0 lib/psychometric/assessment.rb