Module: Authority::Abilities::ClassMethods

Extended by:
Forwardable
Defined in:
lib/authority/abilities.rb

Instance Method Summary collapse

Instance Method Details

#authorizerClass

Returns of the designated authorizer.

Returns:

  • (Class)

    of the designated authorizer



38
39
40
41
42
43
44
# File 'lib/authority/abilities.rb', line 38

def authorizer
  @authorizer ||= authorizer_name.constantize # Get an actual reference to the authorizer class
rescue NameError
  raise Authority::NoAuthorizerError.new(
    "#{authorizer_name} is set as the authorizer for #{self}, but the constant is missing"
  )
end